cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted

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

I am seeing 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... 

2 REPLIES 2
Community Support Team
Community Support Team

Re: Strange behavior with string manipulation and '\n' line endings

Hi @TimBourguignon,

 

Please share a screenshot of the configuration of your flow when you test the RSS file so we would try to provide a proper workaround for you.

 

Best regards,

Alice

Re: Strange behavior with string manipulation and '\n' line endings

I'm not sure which Settings you mean... I assume it's the RSS Trigger settings?

 

RSSSettings.JPG

 

This would be the feed I'm pulling from: http://fetchrss.com/rss/5783a2a28a93f8b968d827db965475936.xml

Helpful resources

Announcements
thirdimage

Power Automate Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

firstImage

Incoming: New and improved badges!

We've given our badges an overhaul and also added some brand new ones!

fifthimage

Microsoft Learn

Learn how to build the business apps that you need.

sixthImage

Power Platform World Tour

Find out where you can attend!

seventhimage

Webinars & Video Gallery

Watch & learn from the Power Automate Community Video Gallery!

Top Kudoed Authors
Users Online
Currently online: 371 members 5,666 guests
Please welcome our newest community members: