Skip to main content

How to Get the First Item of an Array in Power Automate

· 4 min read
Jagdish Kumawat
Founder @ Dewiride

first() returns the first item of an array. Follow it with ?['field'] to read one of that item's fields, and a value that comes in an array, such as an approval's responses, goes straight into a field, without an Apply to each.

Microsoft's functions reference says it will Return the first item from a string or array. Its example, first(createArray(0, 1, 2)), returns 0.

The example is the approval flow of the Overtime Timesheet app, which saves the approver's comment and name with each decision.

Prerequisites​

Why Responses Is an Array​

An approval can go to several people, so its outputs list every response, each with the approver and their comments. With Approve/Reject - First to respond, the request ends at the first response, so the first item is the one that decided.

Step 1: Read the Comment​

Where the comment goes, here the ApproverComment column of Record the decision, insert this expression (How to Add an Expression in Power Automate):

Record the decision → ApproverComment
first(outputs('Ask_for_approval')?['body/responses'])?['comments']

The expression editor containing first(outputs('Ask_for_approval')?['body/responses'])?['comments']

  • outputs('Ask_for_approval')?['body/responses'] is the array.
  • first(...) is its first response.
  • ?['comments'] is that response's comment.

Step 2: Read the Approver's Name​

The same pattern reads deeper fields. The approver's display name is in the response's responder:

Record the decision → DecisionBy
first(outputs('Ask_for_approval')?['body/responses'])?['responder']?['displayName']

Both appear in the action as first(...) tokens:

Record the decision's advanced parameters, Showing 4 of 8: Status Value set to an if(...) token, ApproverComment and DecisionBy each set to a first(...) token, DecisionOn set to Completion date, and Connected to Overtime Timesheet SharePoint.

The Result​

Daniel Brooks approved Maya Patel's entry with the comment Approved. Thanks for clearing the backlog. The flow saved both, the comment and his name:

The OvertimeEntries row for Maya Patel with Status Approved, ApproverComment Approved. Thanks for clearing the backlog., DecisionBy Daniel Brooks, DecisionOn 08/11/2026 17:11, WorkMonth 2026-11 and Approval Status Approved

Common Mistakes​

MistakeWhat happensDo this instead
Taking the first of Everyone must approve responsesOnly one of several approversLoop over all of them when you need everyone's
last() for the deciderThe last of several, not the firstfirst() with First to respond

Troubleshooting​

SymptomLikely causeFix
An empty commentThe approver didn't write oneExpected
An empty nameThe path to the field is wrong?['responder']?['displayName']
An error about the argumentThe value isn't an array or textPass the array itself

FAQ​

Does first() work on text?​

Yes: Microsoft's example first('hello') returns "h".

What about the outcome?​

Outcome isn't in the array; it's one value, Approve or Reject: outputs('Ask_for_approval')?['body/outcome'].

Conclusion​

first(array)?['field'] reads a field of an array's first item in one expression. For an approval that the first response decides, first(...responses)?['comments'] and ?['responder']?['displayName'] give the decider's comment and name.

Additional Resources​