Hi everybody,
In my flow, I have an array that contains a string with multiple values. The values in the string are separated by the following character "<>". The array looks like this:
{
"Values": "Test 1<>Test 2<>Test 3<>Test 4"
}
I want to replace the character with a new line. So I get this result:
Test 1
Test 2
Test 3
Test 4
Hope someone can help 🙂
You can easily replace the characters when you use the string. But you I don't think you can replace them in the context of the array itself. To replace them when you use the string simply initialize a variable and add a Carriage return to the variable. Then use that variable in a Replace() function on the string.
replace(outputs('Compose'),'<>',variables('varCRLF'))
Like this:
Expression is:
replace(outputs('Compose'), '<>', decodeUriComponent('%0A'))
Hello @seryil ,
loop through the array with 'Apply to each' to process all the items one by one. Since it's an object, not a simple array, you can't use 'Current item' dynamic content directly, you must extend it by the ?['Values'] to access only the values.
For the 'new line' you can then use the decodeUriComponent('%0A') expression that will take the Uri value for a new line (%0A) and convert it into a new line to use in your string.
replace(items('Apply_to_each')?['Values'],'<>',decodeUriComponent('%0A'))
If you need all the values from the array in a single variable, you can initialize a string variable and append the replace(...) expression into that variable.
Learn to digitize and optimize business processes and connect all your applications to share data in real time.
Come together to explore latest innovations in code and application development—and gain insights from experts from around the world.
At the monthly call, connect with other leaders and find out how community makes your experience even better.
User | Count |
---|---|
25 | |
24 | |
23 | |
23 | |
19 |
User | Count |
---|---|
58 | |
40 | |
40 | |
29 | |
24 |