Hi Team,
I have created a boolean global variable on start of app and updating the value of that variable with a textbox on another screen.
However, when I change the value, it needs a trigger of "Run OnStart" to update the variable value.
There's an admin who have access to that screen and can update the value and that value should remain intact inside the app for others.
variable on start of app
Set(
isEnabled,
TextBox2.Value
);
Is there any alternative way to fix this? Can I refresh the app with Refresh() function?
Really appreciate any help with this!
Thank you!
Solved! Go to Solution.
Hi @Divya_R ,
There is no way to execute OnStart during App running, unless you close and open the App again.
The point is, OnStart is one of all those On... properties that could use to append behavior formulas in Canvas Apps. Any formulas that in OnStart could also use in the other properties like OnSelect/OnChange/OnVisible/On... to execute again, only need to copy and paste. On... properties means when... to execute something, no doubt that you could use the same formulas in different places to do a same thing.
Below is the doc about behavior formulas for reference:
https://docs.microsoft.com/en-us/powerapps/maker/canvas-apps/working-with-formulas-in-depth
Hope this helps.
Best regards,
Community Support Team _ Jeffer Ni
If this post helps, then please consider Accept it as the solution to help the other members find it.
Community Support Team _ Jeffer Ni
If this post helps, then please consider Accept it as the solution to help the other members find it.
I am not sure what the purpose of your formula is in this case. You are referencing a .Value property of a textbox...that control doesn't have such a property!
Can you expand on that?
Hi @RandyHayes,
Thanks for your quick response.
I don't see .Text property of textbox and there's only .Value
Then it is not a text input control. Instead of looking on that side of the screen, look at the property pane on the right side and send a screenshot of that.
Ah, you're not in a canvas app, you're in Teams!
So, your initial formula seems to indicate that your isEnabled variable would be a true or false value, but apparently you are setting it to what ever text is typed into that textinput control.
If all of that is the case, then just set the OnChange action of the Textinput control to:
Set(
isEnabled, Self.Value
);
This will update your variable.
Hi @RandyHayes,
I tried, but seems there's an incompatibility issue.
TextBox - OnChange
Set(
isEnabled, Self.Value
);
and on start of app
Set(
isEnable, Texttbox.Value
)
However, I got it working with Toggle and directly using Toggle.Checked in on start of app.
Set(
isEnable, Toggle.Checked
);
Well, that was where I was heading - you originally said it was a boolean variable, but you were setting it to the text of the text input control - not a boolean value.
If you use a toggle, that will be boolean.
Hi @RandyHayes,
I get it. Thanks so much 🙂
But is there any way to refresh the app which triggers "Run OnStart" job? so as soon as I update the variable it refreshes the value on start of app?
Hi @Divya_R ,
There is no way to execute OnStart during App running, unless you close and open the App again.
The point is, OnStart is one of all those On... properties that could use to append behavior formulas in Canvas Apps. Any formulas that in OnStart could also use in the other properties like OnSelect/OnChange/OnVisible/On... to execute again, only need to copy and paste. On... properties means when... to execute something, no doubt that you could use the same formulas in different places to do a same thing.
Below is the doc about behavior formulas for reference:
https://docs.microsoft.com/en-us/powerapps/maker/canvas-apps/working-with-formulas-in-depth
Hope this helps.
Best regards,
Community Support Team _ Jeffer Ni
If this post helps, then please consider Accept it as the solution to help the other members find it.
Community Support Team _ Jeffer Ni
If this post helps, then please consider Accept it as the solution to help the other members find it.
User | Count |
---|---|
122 | |
87 | |
86 | |
75 | |
67 |
User | Count |
---|---|
214 | |
181 | |
137 | |
96 | |
83 |