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

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / Turn a String into Dyn...
Power Automate
Answered

Turn a String into Dynamic JSON Objects

(0) ShareShare
ReportReport
Posted on by 2

Hello. I have a long and awkward string that I would like turned into JSON objects that can be selected as dynamic data later on in my flow. Here's the string:

 

"Sharepoint Link: https://FF.sharepoint.com/:f:/s/PDRRTeam\nRequestor: Benjamin Grimm\nRequestor Email: Benjamin.Grimm@FF.com\nRequested on: 6/8/2023 2:28:51 PM\n\nNAVIGATE TO SHAREPOINT FOLDER ABOVE TO ACCESS THE ASSOCIATED COLLATERAL\n\nBasic Request Details-\nMarket: LI - CT\nService Line: Capital Markets\nOpportunity #: 12345\nLead Broker Name: Ben Grimm \nDeliverable: Flyer\nFormat: \nClient / Property / Project Name: 211 Madison Ave\nDue Date: 2023-06-30\nEvent Date: \nType of Deliverable Requested: \nNew or Existing Deliverable: New Request\nRequested Deliverable Details (Instructions, Updates, Descriptions): Test market with a dash"

 

I would like it turned into something similar to the following:

 

{

   "SharepointLink": "https://FF.sharepoint.com/:f:/s/PDRRTeam",
   "Requestor": "Benjamin Grimm",
   "RequestorEmail": "Benjamin.Grimm@FF.com",
   "RequestedOn": "6/8/2023 2:28:51 PM",

   "Market": "LI - CT",
   "ServiceLine:" "Capital Markets",
   "Opportunity": "12345",
   "LeadBrokerName": "Ben Grimm",
   "Deliverable": "Flyer",
   "Format": "Client / Property / Project Name: 211 Madison Ave",
   "DueDate": "2023-06-30",
   "EventDate": "",
   "TypeofDeliverableRequested": ""
   "NeworExistingDeliverable": "New Request",
   "RequestedDeliverableDetails": "Test market with a dash"

}

 

Can anyone show me a dynamic way to process this conversion? I will be receiving many strings of this type in the future. The main categories will remain the same, but the details will be different each time. Any assistance is appreciated.

 

Thank you, 

 

Dennis

Categories:
  • Verified answer
    takolota1 Profile Picture
    4,980 Moderator on at

    Make a Compose & in the box hit the enter key so you get one linebreak.

     

    Create another Compose & use the expression

    Split(InsertPre-JSONdynamicContentHere, outputs(‘Compose’))

    That should make an array with each line.

     

    Then create another Compose with…

     

    {
    @First(Split(outputs(‘Compose_2’)[0], ‘:’)): Join(Skip(Split(outputs(‘Compose_2’)[0], ‘:’), 1), ‘’),

    @First(Split(outputs(‘Compose_2’)[1], ‘:’)): Join(Skip(Split(outputs(‘Compose_2’)[1], ‘:’), 1), ‘’),

    @First(Split(outputs(‘Compose_2’)[2], ‘:’)): Join(Skip(Split(outputs(‘Compose_2’)[2], ‘:’), 1), ‘’),

    @First(Split(outputs(‘Compose_2’)[3], ‘:’)): Join(Skip(Split(outputs(‘Compose_2’)[3], ‘:’), 1), ‘’),

    ... etc for each of your 15 lines, just changing the array index [#] for each line

    }

     

  • SudeepGhatakNZ Profile Picture
    14,396 Most Valuable Professional on at

    Here is a sample I have put together.

    Things for you to do:

    1) Get rid of the New lines

    2) Store the UTL and Dates in a variable before using the expressions (because they contain 🙂

    3) Restore the values back from variables after the JSON has been formed.

    SudeepGhatakNZ_0-1686696921685.png

     

     

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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the July Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Automate

#1
11manish Profile Picture

11manish 231 Super User 2026 Season 2

#2
David_MA Profile Picture

David_MA 217 Super User 2026 Season 2

#3
Mohsin Ali Profile Picture

Mohsin Ali 170

Last 30 days Overall leaderboard