cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
armanika11
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
v-xida-msft
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
v-xida-msft
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
MPA_User Group Leader_768x460.jpg

Manage your user group events

Check out the News & Announcements to learn more.

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

Welcome Super Users.jpg

Super User Season 2

Congratulations, the new Super User Season 2 for 2021 has started!

Carousel 2021 Release Wave 2 Plan 768x460.jpg

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

Users online (1,596)