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 / How do you split items...
Power Automate
Unanswered

How do you split items inside an array?

(1) ShareShare
ReportReport
Posted on by 62

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:

[
  [
    "0;4;Premium SSD;",
    "1;4;Premium SSD;",
    "2;4;Premium SSD;",
    "3;4;Premium SSD;",
    ""
  ]
]
 
 
 
Now, how do I further split each item of the array, producing an array of arrays?
 
 

 

Categories:
I have the same question (0)
  • Verified answer
    v-bacao-msft Profile Picture
    on at

     

    Hi @Morke ,

     

    Please check the following configuration and see if it helps:

    163.PNG

    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,

  • Morke Profile Picture
    62 on at

    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?

  • v-bacao-msft Profile Picture
    on at

     

    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,

  • Mlimacher Profile Picture
    3 on at

    Nice and simple 👍

  • Jorn75 Profile Picture
    4 on at

    Hi @v-bacao-msft 

    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

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

#2
Tomac Profile Picture

Tomac 405 Moderator

#3
abm abm Profile Picture

abm abm 252 Most Valuable Professional

Last 30 days Overall leaderboard