Skip to main content
Community site session details

Community site session details

Session Id : tUBpff1pmUEupmUVE4CMwl
Power Automate - Building Flows
Unanswered

How to get the elements from a JSON object

Like (0) ShareShare
ReportReport
Posted on 23 Sep 2022 15:25:26 by 143

Hi All, 

 

I am trying to get a string value from within a JSON object that I receive. I would like to have have a string after the ParseJSON step which shows the product names - "Product Name A;Product Name B;Product Name C;Product Name D"

 

 

[
 {
 "CustomerName": "Customer A",
 "DocumentType": "Word",
 "Product": [
 {
 "Value": "Product Name A"
 },
 {
 "Value": "Product Name B"
 },
 {
 "Value": "Product Name C"
 },
 {
 "Value": "Product Name D"
 }
 ]
 }
]

 

 

  • Ellis Karim Profile Picture
    11,177 Super User 2025 Season 2 on 24 Sep 2022 at 17:18:36
    Re: How to get the elements from a JSON object

    The demo flow I posted does not need the Parse JSON action. It uses an expression to "grab" the Product array.

     

    Place your data in to the varJSON variable: 

     

    Snag_9bd5f96.png

     

    However, if you still need to use the Parse JSON function, then modify the expression in the Select action to: 
    body('Parse_JSON')?[0]?['Product']

     

    Snag_9bf66a1.png


    Ellis
    ____________________________________
    If I have answered your question, please mark the post as Solved.
    If you like my response, please give it a Thumbs Up.

  • Dhiran Profile Picture
    143 on 24 Sep 2022 at 15:16:18
    Re: How to get the elements from a JSON object

    Hi @ekarim2020 

     

    Thank you for your answer and I tried your steps but had no success 😞

     

    I also look at the raw output of my ParseJSON step and it also had the word body at the head of of the object. I assumed I could just reference the using this expression "outputs('ParseJSON')?['body']?['Product'] but that also failed.

     

     

     

    {
     "body": [
     {
     "CustomerName": "Customer Name",
     "DocumentType": "Word"
     "Product": [
     {
     "Value": "Product A"
     },
     {
     "Value": "Product B"
     },
     {
     "Value": "Product C"
     },
     {
     "Value": "Product D"
     }
     ]
     }
     ]
    }

     

     

  • Ellis Karim Profile Picture
    11,177 Super User 2025 Season 2 on 23 Sep 2022 at 19:23:21
    Re: How to get the elements from a JSON object

    Hi @Dhiran ,

     

    We can use the Select and Join actions to create the string.

    Snag_505645d.png

    (2) We can use the Select action Product property. We use the Select action to select the first item (0) of the varJSON array variable, and then specify the Product property - which is also an array. The expressions are shown below:

    Snag_5047190.png

    The output of the Select action is an array of product names:

     

    [
     "Product Name A",
     "Product Name B",
     "Product Name C",
     "Product Name D"
    ]

     

     

    (3) Finally, we can join all the product names together using the Join action

    Snag_504a775.png

    The output of the Join action is:

     

    Product Name A;Product Name B;Product Name C;Product Name D

     


    Ellis
    ____________________________________
    If I have answered your question, please mark the post as Solved.
    If you like my response, please give it a Thumbs Up.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Announcing our 2025 Season 2 Super Users!

A new season of Super Users has arrived, and we are so grateful for…

Paul Stork – Community Spotlight

We are honored to recognize Paul Stork as our July 2025 Community…

Congratulations to the June Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Automate

#1
Tomac Profile Picture

Tomac 986 Moderator

#2
stampcoin Profile Picture

stampcoin 699 Super User 2025 Season 2

#3
Riyaz_riz11 Profile Picture

Riyaz_riz11 577 Super User 2025 Season 2