cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
New Member

Unable to utilize ResultSets value with Condition in Flow

Good Evening,

 

I have been braking my head around this for 2 days now. I am hoping someone could shed some light on the matter.

 

Situation:

I have a powerapp with an on-site premises gateway.

I have a stored procedure that is called spGetWeeklyInstallRec:

   {  DECLARE @Result int
     SET NOCOUNT ON;

     SET @Result = (SELECT ID
     FROM WEEKLY_INSTALLATION
     WHERE EQUIP_ID=@Id
          AND JOB_NO=@JobNo)

     SELECT ID = CASE WHEN @Result IS NULL THEN 0 ELSE @Result END }

 

In my flow I I call this procedure after feeding it the required parameters, it works great.

Then I need to set a condition step where if the return ID is greater than or equal to 1 do something1

else do something2. But when my flow is ran it keeps crashing on the condition step every time.

 

Stored Procedure ResultSets:

ResultSets

{ "Table1": [ { "ID": 1 } ] }

 

Condition Code:  

@greaterOrEquals(body('Execute_stored_procedure')?['ResultSets']?['Table1']?['ID']?['value'], 1)

 

The above code is just the last thing I tried. I greatly appreciate any assistance you can give me.

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
New Member

Re: Unable to utilize ResultSets value with Condition in Flow

To anyone having the same issue I found the solution to this issue. You must treat the ResultSet as an array

 

Proper way to reference:

Stored Procedure ResultSets:

ResultSets

{ "Table1": [ { "ID": 1 } ] }
 

Condition Code:  

@greaterOrEquals(body('Execute_stored_procedure')?['ResultSets']?['Table1']?[0]?['ID'], 1)

View solution in original post

2 REPLIES 2
Highlighted
New Member

Re: Unable to utilize ResultSets value with Condition in Flow

To anyone having the same issue I found the solution to this issue. You must treat the ResultSet as an array

 

Proper way to reference:

Stored Procedure ResultSets:

ResultSets

{ "Table1": [ { "ID": 1 } ] }
 

Condition Code:  

@greaterOrEquals(body('Execute_stored_procedure')?['ResultSets']?['Table1']?[0]?['ID'], 1)

View solution in original post

Highlighted
Anonymous
Not applicable

Re: Unable to utilize ResultSets value with Condition in Flow

Thank you so much. Saved my 2nd day 😉

Helpful resources

Announcements
Community Conference

Power Platform Community Conference

Come join us today! Find your favorite faces from the community presenting at the Power Platform Community Conference!

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.

Upcoming Events

Experience what’s next for Power Automate

See the latest Power Automate innovations, updates, and demos from the Microsoft Business Applications Launch Event.

Top Solution Authors
Top Kudoed Authors
Users online (3,061)