cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
sgokul95
Helper I
Helper I

Not able to retrieve the value from the flow and save it in the variable in PowerApps

Hi All,

 

I am a newbie to Power Automate flows. I have an Instant cloud flow that calculates a number and returns the number to the PowerApps. I have triggered the flow (GetTestNumber) in the PowerApps and could note that the flow is triggered and gets succeeded and also it has a number in its output property "finaltestnumber". 

 

sgokul95_0-1640788285573.pngsgokul95_1-1640788304886.png

 

I am triggering the flow in the OnSelect of a button and saving the value of finaltestnumber using the UpdateContext. I have set this variable to the Button's text property. But the variable remains blank even after the flow is triggered successfully.  

 

Am I missing anything here? Because in the flow history, I can note that the flow ran successfully and also the finaltestnumber has a value. 

 

sgokul95_2-1640788449925.png

sgokul95_3-1640788476977.png

 

Regards,

Gokul S

1 ACCEPTED SOLUTION

Accepted Solutions

As I said, it is a bug that is being worked on.  That workaround has worked for me, but it is a workaround.  The other thing you can try is to convert the number to a string in the flow and return it that way, then convert it to a number in the Power App.  Something like this

UpdateContext({finalNumber: Value( respondnumber.Run().finalnumber)})

 



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

Join me at 365 and PWR EduCon in Chicago
EduCon Chicago 2022

View solution in original post

3 REPLIES 3
Pstork1
Dual Super User
Dual Super User

There's a bug that Microsoft is working on in the Respond to Power Apps action when returning certain data types, number being one of them.  The problem is that although Power Apps is expecting a number its actually receiving a string.  The workaround to fix it is to send a literal number the first time you run the flow from Power Apps.  Then change that literal to be replaced by a variable.  Doing that seems to set the schema correctly and the number comes back as expected.  You will probably have to

  1. remove the flow from the Power App
  2. remove and replace the Respond to Power Apps action in the flow and replace it with one that uses a literal number as the return.
  3. re-add the flow to the Power App
  4. Run it once and verify that number came through
  5. Edit the flow and replace the literal with the output variable you want to send.


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

Join me at 365 and PWR EduCon in Chicago
EduCon Chicago 2022

sgokul95
Helper I
Helper I

Hi @Pstork1 ,

 

Thanks for your help and update. I have tried the workaround as like below steps:

1. Removed the flow from my app. 

2. Removed the Respond to PowerApps action. Added a new Respond to PowerApps action and selected the return type as Number. Then set the output value as number (100).

3. Added the flow to my app.

4. I had run it but still value did not get updated in the button. 

 

Am I missing anything in the 2nd step and does the literal number mean like 100 or 3+2?

 

sgokul95_0-1640867626812.png

I had stored the output of the flow in the variable and set it to the Button's Text property. 

sgokul95_3-1640869171323.png


Before calling the flow (Default value of varNewItemTestNumber- 2) :

sgokul95_2-1640868619348.png

 

After calling the flow:

sgokul95_1-1640868578112.png

 

Regards,

Gokul S

As I said, it is a bug that is being worked on.  That workaround has worked for me, but it is a workaround.  The other thing you can try is to convert the number to a string in the flow and return it that way, then convert it to a number in the Power App.  Something like this

UpdateContext({finalNumber: Value( respondnumber.Run().finalnumber)})

 



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

Join me at 365 and PWR EduCon in Chicago
EduCon Chicago 2022

Helpful resources

Announcements
Register for a Free Workshop.png

Register for a Free Workshop

Learn to digitize and optimize business processes and connect all your applications to share data in real time.

September Events 2022

Check out all of these events

Attend in person or online, there are incredible conferences and events happening all throughout the month of September.

Users online (4,667)