web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / Json values all with t...
Power Automate
Answered

Json values all with the same name, how to parse?

(0) ShareShare
ReportReport
Posted on by 10

I have the following array in PowerFlow.

 

[
{
"name": "Account Manager",
"value": "Joe Svoboda"
},
{
"name": "AutoTask Workplace",
"value": null
},
{
"name": "Backup Solution",
"value": "Datto"
},
{
"name": "Billing POC",
"value": null
}
]

 
I'm guessing I want to strip out the "name" and "value" for each object leaving a useable array?
 
I've tried a replace, but that failed, I'm open to suggestions. 
 
Thanks in advance.
Categories:
I have the same question (0)
  • manuelstgomes Profile Picture
    6,625 on at

    Hi @JoeSvoboda 

     

    That's already a JSON array.

     

    What do you want to get? Something like

    ["Account Manager":"Joe Svoboda",....]

     

    or

     

    ["Account Manager","AutoTask Workplace"]

    ["Joe Svoboda",""]

     

    Or something else?

     

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

    Cheers
    Manuel

  • JoeSvoboda Profile Picture
    10 on at

    Yes, I would like to strip out the "name" and "value" from each object.

     

    ["Account Manager":"Joe Svoboda",....]  would be the preferred outcome.

  • Verified answer
    manuelstgomes Profile Picture
    6,625 on at

    Hey @JoeSvoboda 

     

    Got it. Here you go:

    Screenshot 2020-07-23 at 20.41.19.png

     

    Explaining the steps:

    1. Initialize a variable with your string to be able to parse it.

    Screenshot 2020-07-23 at 20.44.46.png

    2. Replace all null records by "". This is important because you'll want to create a JSON, and it will fail if there are null values. The formula is simple:

    replace(variables('TEST'),'null','""')

    Screenshot 2020-07-23 at 20.44.49.png

    3. Get the JSON. Press "Generate from Sample" and paste your string to generate the structure. If it fails here's the correct one:

    {
     "type": "array",
     "items": {
     "type": "object",
     "properties": {
     "name": {
     "type": "string"
     },
     "value": {
     "type": "string"
     }
     },
     "required": [
     "name",
     "value"
     ]
     }
    }

    4. Create a variable to get your desired array

    Screenshot 2020-07-23 at 20.44.55.png

    5. Concatenate the values and add them to the array created before.

    Screenshot 2020-07-23 at 20.44.58.png

    In this step you can use also the "concat() function" to get exactly the combination of " and ":" that you want.

     

    The result will be something like this:

    [
     "Account Manager:Joe Svoboda",
     "AutoTask Workplace:",
     "Backup Solution:Datto",
     "Billing POC:"
    ]

     

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

    Cheers
    Manuel

  • JoeSvoboda Profile Picture
    10 on at

    Manuel!

     

    You the man!

     

    That worked, I actually followed along with the logic and everything.  Now I just need to implement it in my current flow, but I feel pretty confident.

    Thanks SO much for your assistance!

     

    Joe

  • manuelstgomes Profile Picture
    6,625 on at

    Hey @JoeSvoboda,

     

    I'm glad I could help and even more that your issue is fixed.

     

    Anything that you need to reach out and I'll be more than happy to help.

     

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

    Cheers
    Manuel

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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Leaderboard > Power Automate

#1
trice602 Profile Picture

trice602 398 Super User 2025 Season 2

#2
David_MA Profile Picture

David_MA 331 Super User 2025 Season 2

#3
Expiscornovus Profile Picture

Expiscornovus 203 Most Valuable Professional

Last 30 days Overall leaderboard