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
MPA_User Group Leader_768x460.jpg

Manage your user group events

Check out the News & Announcements to learn more.

V3_PVA CAmpaign Carousel.png

Community Challenge - Giveaways!

Participate in the Power Virtual Agents Community Challenge

Carousel 2021 Release Wave 2 Plan 768x460.jpg

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

R2 (Green) 768 x 460px.png

Microsoft Dynamics 365 & Power Platform User Professionals

DynamicsCon is a FREE, 4 half-day virtual learning experience for 11,000+ Microsoft Business Application users and professionals.

Top Solution Authors
Users online (1,160)