Splitting NewLine Separated String
Please see below. I use a utility flow to create a list from a string of newline-separated values (extracted from a checklist box on a form). When I provide the literal string, the flow works correctly, but the steps do not work as expected when I provide the value list from extracting values from the form. If I put the steps inside the flow, calling the utility flow, I get the same result.
https://app.screencast.com/llIu93OLZJbdV
I don't see any difference in the string values, so maybe you can see something I am missing.
Thanks, Tevis
Answer (1)
Hi Tevis,
Thank you for the helpful video! You were right in your guess -- the reason that it works when you paste in copied text and doesn't work when you pass in a dynamic value is because the new line characters aren't being picked up.
In your utility flow, you're replacing the characters "\r\n" with a comma. This works when you paste in something like "Choice 1\r\nChoice 2\r\nChoice3" because the characters "\r\n" are part of a string -- they're being treated as the literal characters \, r, \, and \n.
But \r\n is actually iPaaS's way of displaying the carriage return new line character, \r\n
.
What you need to do is update the "replace" expression in your utility flow. In the left bubble of the expression, the text to replace, remove "\r\n" and instead type CTRL+Enter. This will create a character that looks like this: ↩ , which translates to \r\n
. You can also use the bulleted list icon to select "carriage return new line", which will do the same thing as CTRL+Enter.
Let me know if that works!
Best,
Carrie
Managing Consultant, TeamDynamix