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

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
Highlighted
Community Support
Community Support

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

Highlighted
Resolver I
Resolver I

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
firstImage

Super User Program Update

Three Super User rank tiers have been launched!

firstImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

firstImage

New & Improved Power Automate Community Cookbook

We've updated and improved the layout and uploading format of the Power Automate Cookbook!

thirdimage

Power Automate Community User Group Member Badge

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

Top Solution Authors
Top Kudoed Authors
Users online (6,092)