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 / Convert JSON Body Into...
Power Automate
Answered

Convert JSON Body Into Delimited String

(0) ShareShare
ReportReport
Posted on by 11

Given the below JSON output, how could I end up with a simple string that is delimited by a character, maybe something like this: "The First Label~The Second Label". In the real example, there will be around 100 entries, but same format. Thanks!

 

 

 

{
 "@odata.context": "https://my365.sharepoint.com/_api/v2.1/$metadata#termStores('root')/termGroups('2a6f2ca2-cba8-4c50-aa65-10144b870758')/termSets('53bccced-77aa-47c7-960b-3826191c4730')/terms('d95867d0-3a02-42ac-821d-55c77f90df82')/children",
 "value": [
 {
 "id": "7f50bcc3-7055-4209-b739-0588c99d64fc",
 "isDeprecated": false,
 "childrenCount": 1,
 "createdDateTime": "2022-02-15T17:53:57.567Z",
 "lastModifiedDateTime": "2022-04-11T17:35:19.357Z",
 "labels": [
 {
 "name": "The First Label",
 "isDefault": true,
 "languageTag": "en-US"
 },
 {
 "name": "Label1",
 "isDefault": false,
 "languageTag": "en-US"
 }
 ],
 "descriptions": [],
 "isAvailableForTagging": [
 {
 "setId": "142a45a6-a5d2-487b-a378-5349eaa77ecc",
 "isAvailable": true
 }
 ]
 },
 {
 "id": "8aa8f51f-28bc-4098-abae-ddaf47694933",
 "isDeprecated": false,
 "childrenCount": 2,
 "createdDateTime": "2022-02-15T17:50:43.04Z",
 "lastModifiedDateTime": "2022-04-08T17:54:21.423Z",
 "labels": [
 {
 "name": "The Second Label",
 "isDefault": true,
 "languageTag": "en-US"
 },
 {
 "name": "Label2",
 "isDefault": false,
 "languageTag": "en-US"
 }
 ],
 "descriptions": [],
 "isAvailableForTagging": [
 {
 "setId": "d87322f7-8bda-458f-adf2-c89153182564",
 "isAvailable": true
 }
 ]
 }
 ]
}

 

 

Categories:
I have the same question (0)
  • VictorIvanidze Profile Picture
    13,079 on at
  • Ambergahill Profile Picture
    11 on at

    I am not seeing how that thread would help here

  • VictorIvanidze Profile Picture
    13,079 on at
  • Ambergahill Profile Picture
    11 on at

    That looks like it could be what I need. I am currently getting this error when it runs. Did I do something wrong? Body is the output from the parse JSON step. "The 'from' property value in the 'select' action inputs is of type 'String'. The value must be an array."

     

    SelectScreenshot.png

  • VictorIvanidze Profile Picture
    13,079 on at

    "value" is an array. Place [0] after ['value'] before ?

  • Verified answer
    WillPage Profile Picture
    2,307 Super User 2025 Season 2 on at

    Input the value property of the JSON into a select with the following expression in the Map field:

    WillPage_0-1651184745498.png

    Next, use Join to join the result with a comma:

    WillPage_1-1651184775683.png

    Now in a Compose, do this:

    WillPage_2-1651184823184.png

    Now another Select. Put the name property in there:

    WillPage_3-1651184862628.png

    Finally, join the result of that with your chosen character:

    WillPage_4-1651184904811.png



    The result:

    WillPage_5-1651184950134.png

    WillPage_6-1651184967167.png

    WillPage_7-1651184976969.png

    WillPage_8-1651184987419.png

     

    WillPage_9-1651185004683.png

     

    You could do this with nested apply to each loops and string variables but I prefer to put the effort into avoiding loops where possible. Hope this helps.

  • Ambergahill Profile Picture
    11 on at

    Will, thank you so much for taking the time to write this up. It was exactly the hand holding I needed. Could you let me know if one thing is possible before I mark it as solution? I am looking for the output to be "The First Label~The Second Label" not "The First Label~Label1~The Second Label~Label2". Thanks again!

  • WillPage Profile Picture
    2,307 Super User 2025 Season 2 on at

    Replace the formula in the first screen shot there with string(first(item().labels))

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 378 Super User 2025 Season 2

#2
David_MA Profile Picture

David_MA 273 Super User 2025 Season 2

#3
Expiscornovus Profile Picture

Expiscornovus 135 Most Valuable Professional

Last 30 days Overall leaderboard