cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Mattw112IG
Impactful Individual
Impactful Individual

Anyone have an idea

Lets say I have a multiline text field in SharePoint with text like:

*Item 1 - First Item

*Item 2 - Second Item

 

In flow I would like to take the contents of that field and convert it to JSON like:

 

{
"element": "*Item 1 - First Item"
},
{
"element": "*Item 2 - Second Item"
}

 

Does anyone have some suggestions or code that would work similarly.

 

So my guess is I would need to split the multiline text field at carriage returns (or asterisk)

Then for each chunk, add in my text around it

Then if it is the last chunk no comma at the end of the line for }

 

Thanks,

Terry

1 ACCEPTED SOLUTION

Accepted Solutions
abm
Super User III
Super User III

Hi @Mattw112IG 

 

Yes you need to use Split expression using carriage return. Then check the length of the split result (array). Depending on the count you can construct the format in a variable type string. Append the string if array length is greater than one starting with comma and your variable.

 

Thanks



Did I answer your question? Mark my post as a solution!

If you liked my response, please consider giving it a thumbs up


Proud to be a Flownaut!

Learn more from my blogPower Automate Video Tutorials

View solution in original post

1 REPLY 1
abm
Super User III
Super User III

Hi @Mattw112IG 

 

Yes you need to use Split expression using carriage return. Then check the length of the split result (array). Depending on the count you can construct the format in a variable type string. Append the string if array length is greater than one starting with comma and your variable.

 

Thanks



Did I answer your question? Mark my post as a solution!

If you liked my response, please consider giving it a thumbs up


Proud to be a Flownaut!

Learn more from my blogPower Automate Video Tutorials

View solution in original post

Helpful resources

Announcements
Process Advisor

Introducing Process Advisor

Check out the new Process Advisor community forum board!

MPA User Group

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group

MBAS on Demand

Microsoft Business Applications Summit sessions

On-demand access to all the great content presented by the product teams and community members! #MSBizAppsSummit #CommunityRocks

Top Solution Authors
Users online (20,668)