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?
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:
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
WarrenBelz
146,596
Most Valuable Professional
RandyHayes
76,287
Super User 2024 Season 1
Pstork1
65,928
Most Valuable Professional