cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
TimBourguignon
Resolver I
Resolver I

Unexplained behavior with string manipulation and '\n' line endings

I created a new flow that does some string manipulation from RSS entries. And I am getting a very strange behavior.

 

1. Desired behavior:

 

I want to split a string into an array with the carriage return '\n' as a separator.

The input is something like this:

 

 

First\n\n\nSecond\n\nThird

 

I expect the following output:

 

 

[
  "First",
  "",
  "",
  "Second",
  "",
  "Third"
]

 

 

I did some testing and it should works fine. On the screenshot below you find:

 

  1. a hardcoded test splitting the hardcoded 'First\nSecond\nThird' string on the fly
  2. A 2 steps test initializing a variable and splitting it afterwards


Source.jpgOutput.jpg

Both versions are working.

 

2. Proof of concept:

 

The string I will be receiving will be like this:

 

 

Kiwicon\n\n\nWellington\n\nNZ...

 

So I hardcoded this string in a variable and build the logic with it. It works fine.

 

successhardcoded.jpg

hardcoded_success.jpg

 

3. The problem

 

Now I initialize this variable with the proper value instead of hardcoding it. This value comes from an RSS file. It is the 'title' value here below:

 

RSS.jpg

 

Instead of the "Kiwicon\n\n\nWellington\n\nNZ..." I expected, the carriage returns '\n' seem to be interpreted. The output is:

 

 

Kiwicon


Wellington

NZ...

 

  

Interpretation.jpg

 

This in turns seems to mess up the splitting:

 

Problem.jpg

 

As you can see, the split didn't happen. And I cannot explain why. Any idea?

1 ACCEPTED SOLUTION

Accepted Solutions
TimBourguignon
Resolver I
Resolver I

This topic had been wrongly flagged as a spam. While it was locked and hidden, I duplicated the topic: https://powerusers.microsoft.com/t5/Building-Flows/Strange-behavior-with-string-manipulation-and-n-l.... Thus this topic can be closed.

View solution in original post

1 REPLY 1
TimBourguignon
Resolver I
Resolver I

This topic had been wrongly flagged as a spam. While it was locked and hidden, I duplicated the topic: https://powerusers.microsoft.com/t5/Building-Flows/Strange-behavior-with-string-manipulation-and-n-l.... Thus this topic can be closed.

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

Users online (18,627)