Good afternoon, I am creating an app that scans a QR code. This is my trigger in power automate. I have problems when I want to pass the variables created in power automate to power apps.
I am following this logic
FlowName.Run().valuefromflow
The problem I have is that it doesn't recognize the variable
From flow I have this
Please help, thank you very much
Solved! Go to Solution.
No it is not necessary and you should avoid using variables as much as possible in your app. There are times for them, but excessive variables is frowned upon (even in the Microsoft docs) and it will make your app more difficult to manage, design and troubleshoot.
In your case, you will need one variable. But think record...not just text.
Your flow is returning a record, not a single text. You are then calling the flow over and over again with the same value to then get each element of your return record. This is excessive and requiring more flow runs than you need.
As mentioned, the only thing you need is the one variable and one call to your flow.
Set(varReturn, PruebaPowerapps.Run(BarcodeScanner1.Value))
That variable (varReturn) is going to contain the record returned from your flow.
So, you can reference any column of the record anywhere in your app.
varReturn.rut
varReturn.nombre
varReturn.mesa
etc...
It appears your issue is that you are putting that formula in a Property, not in a Behavioral Action.
Where are you putting that formula?
I saw in tutorials that they put that output in the "Text" property.
Nope, you can't do that. If you are following a tutorial that tells you to put a flow call in a property...well, I'd stop following that tutorial!!
It needs to be in a behavioral property. That would be on and OnXxxxx action formula for any control that you have that has one and is appropriate.
Ok, but I don't understand. Once I scan the QR code, it triggers a flow in power automate. I just want to display a text that comes from Power Automate. For that in Power Apps I have a text field that has no Onxxx. Do I need another field to display that text ?
No, you just need to perform your action when you trigger the flow. How are you triggering the flow from your app?
I just put this in my OnScan, but only the first set works
Is there any reason for ALL of those variables??
I would suggest you work with a single variable and a single call to your flow.
Set(varReturn, PruebaPowerapps.Run(BarcodeScanner1.Value))
Then, anywhere in your app (like on a Text property of a label), you can reference that variable.
Ex.
varReturn.rut
I have a lot of variables, because they are all different fields from PA and I must show them in the next screen. Or is it not necessary ? Is there another way?
No it is not necessary and you should avoid using variables as much as possible in your app. There are times for them, but excessive variables is frowned upon (even in the Microsoft docs) and it will make your app more difficult to manage, design and troubleshoot.
In your case, you will need one variable. But think record...not just text.
Your flow is returning a record, not a single text. You are then calling the flow over and over again with the same value to then get each element of your return record. This is excessive and requiring more flow runs than you need.
As mentioned, the only thing you need is the one variable and one call to your flow.
Set(varReturn, PruebaPowerapps.Run(BarcodeScanner1.Value))
That variable (varReturn) is going to contain the record returned from your flow.
So, you can reference any column of the record anywhere in your app.
varReturn.rut
varReturn.nombre
varReturn.mesa
etc...
User | Count |
---|---|
252 | |
101 | |
94 | |
47 | |
38 |