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 Platform Community / Forums / Power Automate / Splitting string and p...
Power Automate
Unanswered

Splitting string and performing action for each?

(1) ShareShare
ReportReport
Posted on by

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:

 

1.PNG

 

I have since attempted to set up a flow with identical parameters and it fails, it appears to not be actually splitting the string but

passing the whole input in the compose action. Here's a shot of the error I get.

 

Capture.PNG

 

Is there some sort of formatting error with my JSON? When I set it up to just blast me an email with the output it sends me "@split('Hello #a1',' ')"

Categories:
I have the same question (0)
  • Verified answer
    Community Power Platform Member Profile Picture
    on at

    Found the problem, JSON has to be encapsulated in " " (double quotations) to actually execute or else it'll be sent as a string.

  • Community Power Platform Member Profile Picture
    on at

    having the same problem - where do the double quotes go?

  • Verified answer
    Community Power Platform Member Profile Picture
    on at

    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.):

     

    Capture

     

    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.

     

     

  • Userofoffice365 Profile Picture
    6 on at

    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 !

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 522 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 364 Moderator

#3
abm abm Profile Picture

abm abm 243 Most Valuable Professional

Last 30 days Overall leaderboard