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
Community Conference

Power Platform Community Conference

Check out the on demand sessions that are available now!

Power Platform ISV Studio

Power Platform ISV Studio

ISV Studio is designed to become the go-to Power Platform destination for ISV’s to monitor & manage published applications.

Users online (11,063)