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 / Split an array into Cr...
Power Automate
Unanswered

Split an array into Create Item fields

(0) ShareShare
ReportReport
Posted on by 225

Hi there

 

I have a flow with that initialises two variables (Date and Vessel), then starts an apply to each and within that does an Append to string where it picks out the value of an email subject string and splits it into a three part array, like this:

 

Automate2create_0-1710861026731.png

 

The code used to return this value is this:

split(items('Apply_to_each')?['subject'],'::')
 
I'm almost there, I want to populate the Vessel and Date fields in the Create Item with the 2nd and 3rd returned values (retrospectively) in this example: output for Vessel field would be LUZON STRAIT and output for Date field would be 18-Mar-24.
 
I just can't seem to find the syntax for this?  Surely this must be possible?  Any help would be greatly appreciated. 
 
 
Categories:
I have the same question (0)
  • creativeopinion Profile Picture
    10,502 Super User 2025 Season 2 on at

    @Automate2create To get each item of the array you need to use an array key. The first item of an array starts at 0, second, 1, third 2 etc. 

     

    To get the first item of your array—add a Compose action (optional but good for testing purposes) and use an expression. 

     

    [variable]?[0]

    To remove the leading spaces you can wrap the expression in a trim() function. This expression will return the first item. Repeat for the other items in your array using a 1, 2... etc.

    trim([variable]?[0])

     

    You might also be interested in this YT Tutorial: 3 Mistakes YOU 🫵 are Making with the Apply to Each Action in your Microsoft Power Automate Flow

     

    In this video tutorial I’ll go over how to avoid these common mistakes when using the Apply to Each action in a Power Automate flow:

     

    1️⃣ Looping through a Single Item

    2️⃣ Creating Unnecessary Nested Loops

    3️⃣ Looping through an Unfiltered Array

    At the end of the video I share a few helpful insights when it comes to using the Apply to Each action in your flow.

    IN THIS VIDEO:

     How to avoid the Apply to Each action with a single item array

     How to use the item() function to access dynamic content in an array

     How to prevent unnecessary nested Apply to Each action loops

     How to use the Select action

     How to convert an array to a string with the Select action

    How to use the Filter Query field

     How to count the number of items in an array

     How to use a condition control

     How to use the concurrency control

     How to set a top count

     How to use Compose actions for troubleshooting

     

    Hope this helps!

    If I helped you solve your problem—please mark my post as a solution .
    Consider giving me a 👍 if you liked my response!

    👉 Level up your Power Automate skills by checking out my tutorials on YouTube
    👉 Tips and Tricks on TikTok and Instagram

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