This is going to be a very quick blog post, but hopefully it will show how to create the first() expressions statement in Power Automate.
I created a flow, which has a Get Items step and then a Send an Email V2 step. As I put the email address in from the Get Items step, the Send an Email step gets put into an Apply to each automatically.
But what if I want to get the first email address in the list that is returned in the get items step.

If you shade and copy the Created by email field, and the value field, you get something like this:
Created by email:
@{items('Apply_to_each')?['Author/Email']}
Value:
@{outputs('Get_items')?['body/value']}
We can then use the first expression to get the Author/Email first value returned by the Get Items step:
The expression will look something like this:
first(outputs('Get_items')?['body/value'])?['Author/Email']
This can then be pasted as an expression into the To: field on the Send an Email v2 step:

You can then move the whole Send an email v2 step above the Apply to each and then delete the Apply to each step:

Thanks for reading, brief I know, but sometimes it needs to be.
Jon
Comentários