cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Regular Visitor

Condition to compare only the first record in a result set

My flow is executing a stored proc and it always returns 2 records. I want a condition that only looks at a specific column value in the first record rather than a foreach which applies the condition for both the records.

 

Current condition: @equals(items('Apply_to_each')?['AverageDurationSecDBExe'], '10')

 

Is this possible by modifying the syntax above to look at only the first row? My output is just a resultset from a storedproc.

 

Thanks,

Arun

1 ACCEPTED SOLUTION

Accepted Solutions
Community Support
Community Support

Hi @armanika11,

 

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

Could you show a bit more about the result that the stored procedure returns in flow?

Further, could you please share more details about your stored procedure?

I have made a test on my side and the flow's configuration as below:12.JPG

 The flow works successfully as below:2.JPG

 

13.JPGIf you want to achieve first record, please take a try with the following formula:

@first(body('Execute_stored_procedure')?['resultsets']?['Table1'])

Then achieve the specific column value in first record:

@first(body('Execute_stored_procedure')?['resultsets']?['Table1'])?['ColumnName']

Note: You can upload a pbix file to Onedrive or any web storage and share the link. Do mask sensitive data before uploading

 

Best regards,

Kris

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.

View solution in original post

1 REPLY 1
Community Support
Community Support

Hi @armanika11,

 

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

Could you show a bit more about the result that the stored procedure returns in flow?

Further, could you please share more details about your stored procedure?

I have made a test on my side and the flow's configuration as below:12.JPG

 The flow works successfully as below:2.JPG

 

13.JPGIf you want to achieve first record, please take a try with the following formula:

@first(body('Execute_stored_procedure')?['resultsets']?['Table1'])

Then achieve the specific column value in first record:

@first(body('Execute_stored_procedure')?['resultsets']?['Table1'])?['ColumnName']

Note: You can upload a pbix file to Onedrive or any web storage and share the link. Do mask sensitive data before uploading

 

Best regards,

Kris

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.

View solution in original post

Helpful resources

Announcements
PP Bootcamp Carousel

Global Power Platform Bootcamp

Dive into the Power Platform stack with hands-on sessions and labs, virtually delivered to you by experts and community leaders.

secondImage

Power Platform Community Conference On Demand

Watch Nick Doelman's session from the 2020 Power Platform Community Conference on demand!

MPA Community Blog

Power Automate Community Blog

Check out the community blog page where you can find valuable learning material from community and product team members!

Users online (3,678)