Skip to main content

Notifications

Community site session details

Community site session details

Session Id :
Power Automate - Using Flows
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?

 

 

  • jgtokyo Profile Picture
    5 on at
    Re: syntax for using "or"

    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', '')),' ',','))

     

     

  • v-yuazh-msft Profile Picture
    on at
    Re: syntax for using "or"

    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

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

🌸 Community Spring Festival 2025 Challenge 🌸

WIN Power Platform Community Conference 2025 tickets!

Markus Franz – Community Spotlight

We are honored to recognize Markus Franz as our April 2025 Community…

Kudos to the March Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 146,596 Most Valuable Professional

#2
RandyHayes Profile Picture

RandyHayes 76,287 Super User 2024 Season 1

#3
Pstork1 Profile Picture

Pstork1 65,928 Most Valuable Professional

Leaderboard

Featured topics

Restore a deleted flow