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 Automate
Unanswered

syntax for using "or"

(0) ShareShare
ReportReport
Posted on by 5

I want to split a string into an array at all spaces and carriage returns.

 

I would expect the syntax to be split(body('Html_to_text'),or(' ','\n')),  but flow requires the "or( )" to return a boolean.  

 

Can someone tell me what the proper syntax for this would be in flow?

 

 

Categories:
I have the same question (0)
  • v-yuazh-msft Profile Picture
    Microsoft Employee on at

    Hi @ jgtokyo,

     

    Could you please share a screenshot of the configuration of your flow?

    Could you please share more details about the string that you would like to split into an array?

     

    The expression "or( )" requires to return a boolean, you could refer to link below to learn more about the workflow definition language:

    https://docs.microsoft.com/en-us/azure/logic-apps/logic-apps-workflow-definition-language

     

    I have made a test on my side to split a string into an array at spaces and split a string into an array at carriage returns, however, the flow wouldn't work to check the ' ' and '\n'.

    You could take a try to use expresssion substring() to realize your needs.

     

     

     

    Regards,
    Alice Zhang

  • jgtokyo Profile Picture
    5 on at

    Hi Alice,

     

    Thank you for taking the time to answer.

     

    I am essentially trying to create a statistical list of words used in the body of emails and the number of times they are used.  

     

    The problem I was having was that I was trying to create an array using split function splitting at spaces, but it put \n at the end of words followed by a carriage return, making those words useless.

     

    After much searching, I found a functional workaround by using uriComponentToString by re-writing spaces, punctuation, and CRLFs as commas and then using split() at the comma:

    tolower(replace(uriComponentToString(replace(uriComponent(body('Html_to_text')), '%0A', '')),' ',','))

     

     

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Congratulations to the March Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Automate

#1
Haque Profile Picture

Haque 604

#2
Valantis Profile Picture

Valantis 502

#3
Vish WR Profile Picture

Vish WR 417

Last 30 days Overall leaderboard