cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Frequent Visitor

Set() function is not updating in designer

In my App.OnStart handler, I use a Set() function to set a global variable.  This works fine.  However, if I modify the parameters of the Set(), the variable remains empty.  For example, I might use

 

Set(KnightMessage, "I smell elderberries")

 

and when I enter the designer and run the app, it works.

 

But if I edit it to say 

 

Set(KnightMessage, "Tis but a flesh wound")

 

and run the app (again, in the designer) KnightMessage is empty.

 

I understand that variables are not updated if the Set value changes at runtime, but surely it should update, well, "OnStart?"

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Power Apps
Power Apps

Re: Set() function is not updating in designer

When you say you "run the app in the designer", are you talking about pressing the "Play" button in the top-right corner? If so, this doesn't start the app from "the start" - for example, if you were in a second screen instead of the first one, that is the screen that would be playing. That button is more of a "preview" of the current screen.

ForumPost001.png

To run the OnStart property of the app, you can select the '...' near the app in the tree view, and choose "Run OnStart", or you can close and reopen the app (when the app is opened, OnStart is run).

Hope this helps!

View solution in original post

3 REPLIES 3
Highlighted
Power Apps
Power Apps

Re: Set() function is not updating in designer

When you say you "run the app in the designer", are you talking about pressing the "Play" button in the top-right corner? If so, this doesn't start the app from "the start" - for example, if you were in a second screen instead of the first one, that is the screen that would be playing. That button is more of a "preview" of the current screen.

ForumPost001.png

To run the OnStart property of the app, you can select the '...' near the app in the tree view, and choose "Run OnStart", or you can close and reopen the app (when the app is opened, OnStart is run).

Hope this helps!

View solution in original post

Highlighted
Frequent Visitor

Re: Set() function is not updating in designer

Thank you, Carlos, that is an excellent description of what is happening, and helps immensely.

Highlighted
Super User III
Super User III

Re: Set() function is not updating in designer

Quite curious, if you make changes to the variable as; Set(KnightMessage, "Tis but a flesh wound")

It should reflect "Tis but a flesh wound" after you restart

------------

If you like this post, give a Thumbs up. Where it solved your request, Mark it as a Solution to enable other users find it.

Helpful resources

Announcements
Community Conference

Power Platform Community Conference

Check out the on demand sessions that are available now!

Power Platform ISV Studio

Power Platform ISV Studio

ISV Studio is designed to become the go-to Power Platform destination for ISV’s to monitor & manage published applications.

secondImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Tech Marathon

Maratón de Soluciones de Negocio Microsoft

Una semana de contenido con +100 sesiones educativas, consultorios, +10 workshops Premium, Hackaton, EXPO, Networking Hall y mucho más!

Top Solution Authors
Top Kudoed Authors
Users online (5,954)