I found a question from almost a year ago about splitting a string into and array of substrings.
This was suggested as the solution by yoshihirok and v-micsh-msft:
I found a question from almost a year ago about splitting a string into and array of substrings.
This was suggested as the solution by yoshihirok and v-micsh-msft:
Hi,thanks, but what if we want to make a different action for each item ?
For example I would like to copy each item in their own excel columns.
thanks !
What worked for me, and be prepared for it to change because flows seems to be changing regularly, is wrap the entire JSON command in quotes. I suspect this is because it is a Key:Value pair to be sent in a REST request to flows backend in Azure.
E.g. (Compose)
"@split('This-String-Will-Split','-')"
and (Compose 2 in applyforeach)
"@item"
But when the flow is saved and run it appears in the edit view as this (Take note that the second output is from the @item output not the first compose.):
So in my case, I was working on enabling notifications to groups in flows rather than just each user. I created a workflow in SP that uses an admin account to check against group members in a given group selected by the user creating a notification. The admin account then adds a temporary entry for each user in the group split by a comma. This is where I use the for each you see. The section in the first compose "triggerBody()?['Group_x003a_Members']?['Value']" gets the linked list I'm using and gets the 'Group_x003a_Members' field containing the list of items to split. I then send a message to each of them and voila! We now have a notification center backend to send reminders to departments and groups.
Hope this helps a little with your endeavours once you see "@split(a,b)" and "@item()" used in a real example. Flows is not quite there yet for most production systems but get your learning in now so you can be ahead of the curve. Feel free to ask me any questions, I don't know much but I'll tell you what I can.
Kind Regard,
ADMCharles.
having the same problem - where do the double quotes go?
Found the problem, JSON has to be encapsulated in " " (double quotations) to actually execute or else it'll be sent as a string.