cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
JonyLima
New Member

How to split a text to a JSON?

1 - I have this text in a compose
APPLE
BANANA
ORANGE

2 - I want get this list in a json output.
[
"APPLE",
"BANANA",
"ORANGE"
]

1 ACCEPTED SOLUTION

Accepted Solutions
gamoraes
Memorable Member
Memorable Member

Hi @JonyLima 

 

I use a 3 compose approach to solve this.

 

First i have a compose with your textimage.png

Second a compose to save the "Wrap" charimage.png

inside this i have this expression

decodeUriComponent('%0A')

Third another compose to splitimage.png

inside this i have this expression

split(outputs('Text'),outputs('Decode'))

 

The result is below:image.png

 

 


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

Gustavo Moraes, o astronauta brasileiro do Flow!


View solution in original post

2 REPLIES 2
RezaDorrani
Dual Super User II
Dual Super User II

Hi @JonyLima 

 

You will need to split by new line character

 

Check this sample Flow which does exactly this

https://github.com/rdorrani/Microsoft-Flow/blob/master/FetchstringfromSampletext_20190925204900.zip

 

--------------------------------------------------------------------------------
If this post helps answer your question, please click on “Accept as Solution” to help other members find it more quickly. If you thought this post was helpful, please give it a Thumbs Up.

gamoraes
Memorable Member
Memorable Member

Hi @JonyLima 

 

I use a 3 compose approach to solve this.

 

First i have a compose with your textimage.png

Second a compose to save the "Wrap" charimage.png

inside this i have this expression

decodeUriComponent('%0A')

Third another compose to splitimage.png

inside this i have this expression

split(outputs('Text'),outputs('Decode'))

 

The result is below:image.png

 

 


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

Gustavo Moraes, o astronauta brasileiro do Flow!


Helpful resources

Announcements
MPA Virtual Workshop Carousel 768x460.png

Register for a Free Workshop

Learn to digitize and optimize business processes and connect all your applications to share data in real time.

Power automate tips 768x460 v2.png

Restore a Deleted Flow

Did you know that you could restore a deleted flow? Check out this helpful article.

Microsoft Build 768x460.png

Microsoft Build is May 24-26. Have you registered yet?

Come together to explore latest innovations in code and application development—and gain insights from experts from around the world.

May UG Leader Call Carousel 768x460.png

What difference can a User Group make for you?

At the monthly call, connect with other leaders and find out how community makes your experience even better.

Users online (2,372)