web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / How to execute "Run On...
Power Apps
Answered

How to execute "Run OnStart" step while variable value changes

(0) ShareShare
ReportReport
Posted on by

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!

Categories:
I have the same question (0)
  • RandyHayes Profile Picture
    76,299 Super User 2024 Season 1 on at

    @Divya_R 

    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?

     

  • Divya_R Profile Picture
    on at

    Hi @RandyHayes,

     

    Thanks for your quick response. 

     

    I don't see .Text property of textbox and there's only .Value

    Divya_R_0-1634764931059.png

     

     

     

     

  • RandyHayes Profile Picture
    76,299 Super User 2024 Season 1 on at

    @Divya_R 

    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.

  • Divya_R Profile Picture
    on at

    Hi @RandyHayes ,

     

    PFB,

     

    Divya_R_0-1634765293437.png

     

  • RandyHayes Profile Picture
    76,299 Super User 2024 Season 1 on at

    @Divya_R 

    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.

     

  • Divya_R Profile Picture
    on at

    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
    )

     

    Divya_R_0-1634765959414.png

     

    However, I got it working with Toggle and directly using Toggle.Checked in on start of app.

     

    Set(
     isEnable, Toggle.Checked
    );
  • RandyHayes Profile Picture
    76,299 Super User 2024 Season 1 on at

    @Divya_R 

    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.

  • Divya_R Profile Picture
    on at

    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?

  • Verified answer
    v-jefferni Profile Picture
    Microsoft Employee on at

    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.

  • Divya_R Profile Picture
    on at

    Hi @v-jefferni,

     

    It make sense. Thank you very much for the clarification. 

     

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the July Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 396 Most Valuable Professional

#2
11manish Profile Picture

11manish 134 Super User 2026 Season 2

#3
MS.Ragavendar Profile Picture

MS.Ragavendar 101 Super User 2026 Season 2

Last 30 days Overall leaderboard