web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / only first item in array
Power Automate
Suggested Answer

only first item in array

(0) ShareShare
ReportReport
Posted on by 336
I'm struggling to get only the first item from an array. 
 

 
 
in the update item step, When I add fields from list envelopes it automatically creates a loop as 'list envelopes' can contain more than one item.
I only need the first envelope (which is the newest)

the field is 
items('For_each')?['status']
I have tried wrapping it in a first() but I must have the syntax wrong as I get an error. 
first(items('For_each')?['status'])
 
Thank you!
Categories:
I have the same question (0)
  • Power Platform 1919 Profile Picture
    2,205 Super User 2026 Season 1 on at
    Hi 
    Can you try this expression 
    First('dynamic body content from find envelopes step')?['status']
    Example expression :
    first(body('List_envelopes'))?['status']
     
     
     
    Please give the mentioned solution a try and let me know whether it works for you.
    If it solves your issue, feel free to mark this thread as answered.
    Please make sure to like the response!
    Thanks!
    - Hemanth Sai
  • nick9one1 Profile Picture
    336 on at
    thank you 

    I have tried;
     
    first(body('List_envelopes'))?['status']
    it saves, but errors on execution;
     
    Unable to process template language expressions in action 'Update_item' inputs at line '0' and column '0': 'The template language function 'first' expects its parameter be an array or a string. The provided value is of type 'Null'. Please see https://aka.ms/logicexpressions#first for usage details.'.
     
     
    I presume I dont have the correct step name 'List_envelopes' ?
     
     
     
  • Suggested answer
    rzaneti Profile Picture
    4,483 Super User 2026 Season 1 on at
     
    Your step name is good: the blanks are replaced by underscores in the expressions.
     
    It looks like "List envelopes" is retrieving an empty array for some of the Apply to each iterations. Is this expected?
     
    If yes, consider to include a Condition after "List envelopes", checking if the expression length(body('List_envelopes')) is grater than zero, and then allocate your Update item inside the True block. This condition will prevent this error and "do nothing" for the cases where the List envelopes retrieve zero values.
     
    Let me know if it works for you or if you need any additional help!
     
    If this solved your issue, please mark it as Accepted Answer.
    👍 If it helped, feel free to give it a like!

    🌐 Explore more Power Platform content on my Website or on my ▶️ YouTube
    💼 Find me on LinkedIn
  • nick9one1 Profile Picture
    336 on at

    Thanks.

    The List Envelopes step isn’t blank, as you can see here. I added a Parse JSON action so I could reference the step name Parse_JSON, but it produced the same result.

    I’ve managed to find a workaround. The List Envelopes action has a Return Number setting, which I’ve set to 1, so it now only returns the newest envelope for each item. Previously, if there were two envelopes per item, the flow would first update the item with the newest envelope, then the loop would overwrite it with the oldest one, which wasn’t useful.

    So I no longer need to use first(), but it would still be interesting to understand why it wasn’t working.


  • Power Platform 1919 Profile Picture
    2,205 Super User 2026 Season 1 on at
    Hi,
    Can you try this 
    first(body('List_envelopes')?['value'])?['status']
     

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Congratulations to the March Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Automate

#1
Haque Profile Picture

Haque 608

#2
Valantis Profile Picture

Valantis 416

#3
11manish Profile Picture

11manish 348

Last 30 days Overall leaderboard