Hi
Im trying to split an email body preview at \r\n\r\n but the split does not seem to work.
split(body('Parse_JSON')?['bodyPreview'], '\r\n\r\n')
I just end up with one line, nothing is split
Solved! Go to Solution.
Hi!
Guess this same problem happens when dealing with CSV files.
If so, some threads in this same community discussing this other topic, like
https://powerusers.microsoft.com/t5/Building-Flows/Split-method-parse-csv/td-p/514345
Use uriComponent() function to convert the string into URI code, then use replace() function to replace line separator("%0D%0A") and add ";" instead, then use decodeUriComponent() to decode it
...
Then use the split() function to create an array:
split(outputs('Compose'),';')
Hope this helps
Proud to be a Flownaut!
Hi!
Guess this same problem happens when dealing with CSV files.
If so, some threads in this same community discussing this other topic, like
https://powerusers.microsoft.com/t5/Building-Flows/Split-method-parse-csv/td-p/514345
Use uriComponent() function to convert the string into URI code, then use replace() function to replace line separator("%0D%0A") and add ";" instead, then use decodeUriComponent() to decode it
...
Then use the split() function to create an array:
split(outputs('Compose'),';')
Hope this helps
Proud to be a Flownaut!
\r can be addressed as decodeUriComponent('%0D')
\n as decodeUriComponent('%0A')
One simple solution with multiple \r\n\r\n as follows:
split(body('Parse_JSON')?['bodyPreview'], decodeUriComponent('%0D%0A%0D%0A'))
Thanks for that; worked for me - and only thing that did, after trying other suggestions
Hi Ken,
I sent my email body to a variable and wrote the following expression in a compose action.
Quick test of the ADO 'Create a Work Item' action seems to indicate it differs from field to field.
Description - seem to prefer a html <br>
Repro Steps - seem to truncate any line breaks
Best way to find out is looking at the Power Automate run results input/output and experiment with different line break types.
This is what worked.
Awesome - nice solution.
Will add that to my list of script snippets.
User | Count |
---|---|
91 | |
40 | |
23 | |
20 | |
16 |
User | Count |
---|---|
128 | |
48 | |
47 | |
27 | |
27 |