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

Notifications

Announcements

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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 525 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 324 Moderator

#3
abm abm Profile Picture

abm abm 232 Most Valuable Professional

Last 30 days Overall leaderboard