Hi
I have a single string which I need to split two times.
I have no issues splitting it the first time like this way:
String: "0;1;2; | a;b;c; | A;B;C; |"
Action: Initiate Variable
Name: varArray
Type: Array
Action: Set Variable
Input: varArray
Value: split('string','|')
Output:
I'm just wondering how the flow should look after apply to each if I want to add these text to a mail. How can I append these text in a mail (or an approval flow).
Best regards Jorn
Best regards Jorn
Nice and simple 👍
Hi @Morke ,
The Split() function will return an array. We generally use Apply to each to traverse the elements in the array, and the items() function is used to get the elements of each traversal.
If the element is an object, then we can get the property value through items()[‘PropertyName’].
You can use Apply to each to get each element and apply it to other actions, but the action must also be configured in Apply to each.
In addition, since the return value is an array, we can use index to get the value of each element. Like: You can get the value of the first element in the array through split ('string', '|') [0].
For more details, please refer to WDL function:
By doing more tests, we can easily master Data operations in Power Automate.
Best Regards,
Thank you for the help. This works.
I have a doubt, what's the reference to "items()"? I want to understand how it works.
Also:
How can I use all the resulting split strings? I mean how do I use them as objects further down in the flow after this split? What's the reference to them?
Hi @Morke ,
Please check the following configuration and see if it helps:
We could use items('Apply_to_each') to get the item of the array and continue to use split() function to handle it.
Hope this helps.
Best Regards,
WarrenBelz
146,745
Most Valuable Professional
RandyHayes
76,287
Super User 2024 Season 1
Pstork1
66,091
Most Valuable Professional