cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Anonymous
Not applicable

Fetch first record of union output

I am building a flow and I want to fetch the first row value of the output of an union function used loop input.

 

I am trying to using first function to fetch the first records of each union set of outputs in the array but the flow is not working properly. Below is the flow:

Capture.PNG

union (

 

first function input in compose action

 

first(body('Exceltable')?['Value'])?['Email']
body('Exceltable')?['Value']?[0]?['Email']
 
I am trying to fetch first email record in each union to use in in email TO address.
The flow is picking the very first record of email for every union but not the first record of every union of values.
 
kindly suggest what needs to be changed.
Thanks in advance.
 

 

1 REPLY 1
v-yiwenxie-msft
Microsoft
Microsoft

Hi @Anonymous 

 

Please don’t use the two actions of ‘Apply to each’ together. The flow will run too much times for the two actions of 'Apply to each'.

You can simply try the action of ‘filter array’ in the ‘Apply to each’ for ‘Vnumber’.

 

In my case, I want to get the first record of every union of values for the column 'Email address'.

 

This is what my excel table looks like:

2.26-15.PNG

 

The result of my flow is:

‘Compose 2’ contains only one item each time, which is the first record of every union of values.

2.26-16.PNG2.26-17.PNG

 

The following flow is for your reference:

2.26-14.PNG

The function used:

union(array('kirax@domain.com'),array('kirax2@domain.com'))

first(body('Filter_array'))

 

Best Regards,
Community Support Team _ Kira Xie
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Helpful resources

Announcements
UG GA Amplification 768x460.png

Launching new user group features

Learn how to create your own user groups today!

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

Top Solution Authors
Top Kudoed Authors
Users online (2,723)