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 Automate
Unanswered

Splitting an array

(0) ShareShare
ReportReport
Posted on by 1,934 Moderator

Hello:

 

I have an array that looks like this:

[
 "email_1@domain.edu",
 "email_2@domain.edu"
]

I would like to split it into an array with two rows. One address per row. Could someone please show me how to do that? @Pstork1 

 

Thank you,

Anne

Categories:
I have the same question (0)
  • Pstork1 Profile Picture
    68,707 Most Valuable Professional on at

    I'm not sure what you are trying to do.  If its already an array its already two rows.  But if its a string. Try the following

     

    split(substring(Inputarray,1,sub(length(Inputarray),2)),',')

     

  • MJain Profile Picture
    2,450 on at

    Hi @annetoal ,

     

    Considering you are already having an array and you would want to do some processing on this data, please try to use Apply to each which acts as a loop Capture.JPG

     

    in the input of this loop please use your array variable as I have used Test Array.

     

    Thanks

  • annetoal Profile Picture
    1,934 Moderator on at

    I didn't explain myself very well. I am trying to

    1. walk through the list of emails and find all files that are associated with each email.

    2. Make a html table of all the files associated with each email address.

    3. Mail each address in the list with a mail that contains the table of all the documents mentioned in 2.

     

    @Pstork1  @ManishJain Problem is the code is not looping correctly. Sending a mail to the output of that array yields this address line:

    ["email_1@domain.edu","email_2@domain.edu"];

    I don't want to mail both at once; I need to mail each one separately. I concluded that splitting the array into two rows would let the apply to each step walk through the list of emails one at a time. Was that reasoning flawed?

     

    Using Split on an array results in an error. Please advise.

     

    If it helps, here is the current code. A Terminate has been inserted to speed up testing--it will be deleted later. Notice the ODATA filter query and sort in the properties step.

    annetoal_0-1617974467642.png

    annetoal_1-1617974651821.png

    annetoal_2-1617974716104.pngannetoal_3-1617974797162.png

    annetoal_4-1617974950319.png

    annetoal_5-1617974984873.png

    Many thanks for any help,

    Anne

     

  • Pstork1 Profile Picture
    68,707 Most Valuable Professional on at

    The key here is to sort the input by email, then once you've found all the records for the first email , create the table and send the email.  You can do that by saving the last email processed and checking whether a new row matches it.  If it does keep processing, if it doesn't send the email.  Don't store the output until everything is processed.  Send it periodically. 

     

    I just went through a similar scenario with another post.  Here's the thread.  If you look at my responses you will find a full sample with screenshots towards the bottom.

    Re: Ignore duplicate email addresses when sending ... - Power Platform Community (microsoft.com)

  • annetoal Profile Picture
    1,934 Moderator on at

    Thanks, that clarifies things considerably. I will try to create that. If you by chance have any sample code you could share, that would give me a basis to work from. All assistance gratefully received.

     

    Thank you,

    Anne

  • Pstork1 Profile Picture
    68,707 Most Valuable Professional on at

    Sample code is all in the screenshots on that post.  

  • annetoal Profile Picture
    1,934 Moderator on at

    Like Socrates' "the answers are within you." Okay, I'll go back to my nonworking code. Thanks again.

     

    a

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

#2
Tomac Profile Picture

Tomac 321 Moderator

#3
abm abm Profile Picture

abm abm 237 Most Valuable Professional

Last 30 days Overall leaderboard