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

update a variable from flow

Anyone know if its possible to update a variable from flow. I have a spinner that is visible when I run a flow from powerapps. My visible property: UpdateContext({varSpinner:true});NCAThreshold.Run(insert.Text); UpdateContext({varSpinner:false}) 

The problem is the flow runs a stored procedure but the spinner stops displaying after the first step in the flow. Is there a way I canput the last part UpdateContext({varSpinner:false})  in a flow and send it back to powerapps so the spinner/ lopading icon only disappears when the flow has finished?

7 REPLIES 7
Dual Super User III
Dual Super User III

 


-------------------------------------------------------------------------
If I have answered your question, please mark your post as Solved.
If you like my response, please give it a Thumbs Up.
Dual Super User III
Dual Super User III

You can return a value from the Flow when it completes and use that value to update your context.  The action you need is Respond to PowerApps.  Have that return a False value from the Flow.  Then modify the run command that calls the Flow like this.

UpdateContext({varSpinner:true});UpdateContext({varSpinner:NCAThreshold.Run(insert.Text)}) 

That will set the variable to true and then start the flow.  When the flow completes the return value will update varSpinner.



-------------------------------------------------------------------------
If I have answered your question, please mark your post as Solved.
If you like my response, please give it a Thumbs Up.
Frequent Visitor

Thanks. It almost works but I might be something wrong. It looks as though when I put in that part it runs the stored procedure multiple times. The spinner goes away but then when I look at the database there looks like multiple runs of the stored procedure.

My flow looks as follows:

PowerApps -> execute stored procedure -> respond to powerapps.

I selected output as Text.

Not sure if this helps but here's the JSON file for the respond to powerapps section

{
"kind": "PowerApp",
"inputs": {
"statusCode": 200,
"body": {
"spin": "false"
},
"schema": {
"type": "object",
"properties": {
"spin": {
"title": "spin",
"type": "string",
"x-ms-dynamically-added": true
}
}
}
}
}
Dual Super User III
Dual Super User III

Not sure why it would be running multiple times.  Is the respond action at the end of the Flow?  Also make sure its not in a Loop.



-------------------------------------------------------------------------
If I have answered your question, please mark your post as Solved.
If you like my response, please give it a Thumbs Up.

Hi @Ph ,

Could you show me your flow's screenshoot?

What's more, I suggest you post your issue here:

https://powerusers.microsoft.com/t5/Microsoft-Flow-Community/ct-p/FlowCommunity

The engineers there is more professional about flow, they can provide better advice.

 

 

Best regards,

Community Support Team _ Phoebe Liu

Community Support Team _ Phoebe Liu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Frequent Visitor

Thanks. I deleted the button and tried to recreate it but now it looks like PowerApps can evaluate this part

;UpdateContext({varSpinner:NCAThreshold.Run(insert.Text)})

 

Thanks I'll post it to that group as well. Not sure if the issue is in my flow or powerapps.

My flow:

 

powerapp.PNG

Helpful resources

Announcements
New Badges

New Solution Badges!

Check out our new profile badges recognizing authored solutions!

New Power Super Users

Congratulations!

We are excited to announce the Power Apps Super Users!

Power Apps Community Call

Power Apps Community Call: February

Did you miss the call? Check out the Power Apps Community Call here.

Microsoft Ignite

Microsoft Ignite

Join digitally, March 2–4, 2021 to explore new tech that's ready to implement. Experience the keynote in mixed reality through AltspaceVR!

Top Solution Authors
Top Kudoed Authors
Users online (51,883)