Showing results for 
Search instead for 
Did you mean: 
jeffha77 Helper I
Helper I

Target array item in compose

I'm trying to concatenate a string with email address from a multi choice people picker. As compose does not allow the use of the people picker data im doing an update item and then pulling the data from that update item. I'm having issues with the compose, as the people picker was multi choice it made the update item a loop so the data is in an array. When i run the compose it doesnt work becuase it can access the array.




I need to figure out how to target the first item in this array -> body('Update_item')?['imageurl']

Community Support
Community Support

Re: Target array item in compose

Hi @jeffha77,


Could you please share a screenshot of your flow's configuration?

Could you please show a bit  more about your SharePoint list?

Further, could you please share a bit more about the array that you mentioned?


If you want to target the first item of an array, I think the first() function could could achieve your needs. I have made a test on my side and please take a try with the following workaround:

  • Add a proper trigger, here I use Flow Button trigger.
  • Add a Variables-> "Initialize variable" action, Name set to OriginalArray, Type set to Array and Value set to the following formula:
    "Name": "Kris",
    "Age": 24
    "Name": "Angelina",
    "Age": 27
    "Name": "Ancherl",
    "Age": 29

Note: I use the "Initialize variable" action to create an array in my flow.


  • Add a "Compose" action, Inputs set to the following formula:

Image reference:2.JPG

The flow works successfully as below:3.JPG


On your side, if you want to target the first item in this array -> body('Update_item')?['imageurl'], please take a try with the following formula within "Compose" action:





Best regards,


Community Support Team _ Kris Dai
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
jeffha77 Helper I
Helper I

Re: Target array item in compose

This is the whole flow,



This is where im having the issue, under if no,



 using "first()" does not work, i still get the same error


Unable to process template language expressions in action 'Compose_2' inputs at line '1' and column '2153': 'The template language expression 'CONCAT('',REPLACE(First(body('Update_item...')' cannot be evaluated because property 'imageurl' cannot be selected. Array elements can only be selected using an integer index. Please see for usage details.'.

New Member

Re: Target array item in compose

You need to move ?['imageurl'] outside the bracket
from the inside to the outside:
body('Update_item') - the body of your item
first() - select first row of that body
?['imageurl'] - select index imageurl from the selected line
the full string now reads as follows:

Helpful resources

MBAS Gallery 2020

MBAS Gallery 2020

Watch Microsoft Business Applications Summit sessions on-demand.


New Ranks and Rank Icons released on April 21!

The time has come: We are finally able to share more details on the brand-new ranks coming to the Power Automate Community!


Now Live: Power Virtual Agents Community!

We are excited to announce the launch of Power Virtual Agents Community. Check it out now!


New & Improved Power Automate Community Cookbook

We've updated and improved the layout and uploading format of the Power Automate Cookbook!


Power Automate Community User Group Member Badge

Fill out a quick form to claim your user group badge now!


Community Summit North America

The top training and networking event across the globe for Microsoft Business Applications

Top Solution Authors
Users online (2,230)