web
You’re offline. This is a read only version of the page.
close
Skip to main content
Community site session details

Community site session details

Session Id :
Power Automate - Building Flows
Unanswered

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

(0) ShareShare
ReportReport
Posted on by

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... 

I have the same question (0)
  • v-yuazh-msft Profile Picture
    on at
    Re: Strange behavior with string manipulation and '\n' line endings

    Hi @Anonymous,

     

    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

  • Community Power Platform Member Profile Picture
    on at
    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

  • IrinaP Profile Picture
    2 on at
    Re: Strange behavior with string manipulation and '\n' line endings

    Hi Tim & the Power Automate Community, 

     

    Have you or anyone else been able to split an input string (not hardcoded) by a new line character ('\n') via the built-in Power Automate split() function? I am having the same issue as the OP, where the split() function does not work on a string containing new line characters. I expected split('somestring\nteststring', '\n') to return two items: 'somestring' and 'teststring' but Power Automate returns the original string, ignoring the new line characters. It would be great to know if someone has gotten string splitting to work on new line characters in Microsoft Power Automate workflows. 

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Chiara Carbone – Community Spotlight

We are honored to recognize Chiara Carbone as our Community Spotlight for November…

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 614 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 401 Moderator

#3
chiaraalina Profile Picture

chiaraalina 282

Last 30 days Overall leaderboard