cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Ph
Level: Powered On

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
Dual Super User

Re: update a variable from flow

 


-------------------------------------------------------------------------
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
Dual Super User

Re: update a variable from flow

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.
Ph
Level: Powered On

Re: update a variable from flow

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
Dual Super User

Re: update a variable from flow

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.
Community Support Team
Community Support Team

Re: update a variable from flow

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.
Ph
Level: Powered On

Re: update a variable from flow

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)})

 

Ph
Level: Powered On

Re: update a variable from flow

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
thirdimage

Power Automate Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

sixthImage

Power Platform World Tour

Find out where you can attend!

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

fifthimage

Microsoft Learn

Learn how to build the business apps that you need.

Top Kudoed Authors
Users Online
Currently online: 305 members 5,850 guests
Please welcome our newest community members: