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

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / Strange behavior with ...
Power Automate
Unanswered

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

(0) ShareShare
ReportReport
Posted on by Microsoft Employee

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

Categories:
  • v-yuazh-msft Profile Picture
    Microsoft Employee on at

    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
    Microsoft Employee on at

    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

    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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Leaderboard > Power Automate

#1
Mohsin Ali Profile Picture

Mohsin Ali 426

#2
11manish Profile Picture

11manish 349 Super User 2026 Season 2

#3
M Bilal Khan Profile Picture

M Bilal Khan 308

Last 30 days Overall leaderboard