cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Kudo Kingpin
Kudo Kingpin

OnStart - Am I doing something wrong?

I'm using the web version of the studio.

 

In OnStart, I want to create a variable with the User().Email as a value - I was hoping then I could use that in a filter for a data source instead of directly using User().Email, as that is apparently not delegable (based on the blue info dot and message).

 

But my variable doesn't seem to be set on start.

 

Function:

Set(CurrentUser, User().Email)


I put a label on the form with a value of CurrentUser, run the app, and the variable doesn't appear to have its value set.

 

I also tested using a Navigate function, but that also didn't appear to do anything - on start, I remained on the same screen.

 

Any ideas where I'm going wrong?

1 ACCEPTED SOLUTION

Accepted Solutions
Community Champion
Community Champion

Hi, I did the same and it worked for me. You need to reopen the app in ordert for the OnStart to be triggered.
I use the desktop Studio.
PS There is another very good reason to cache the user value in a varible, that otherwise the function gets called every time it is used and slows performnce.

View solution in original post

3 REPLIES 3
Community Champion
Community Champion

Hi, I did the same and it worked for me. You need to reopen the app in ordert for the OnStart to be triggered.
I use the desktop Studio.
PS There is another very good reason to cache the user value in a varible, that otherwise the function gets called every time it is used and slows performnce.

View solution in original post

Thank you - the trick was to reopen the app, which I hadn't realized. 

Hi, I had been trying to accomplish this in 2020; but as long I am on the studio works but when I preview or publish the app, it doesn't load any information became a big blank space. Any idea?

Helpful resources

Announcements
New Badges

New Solution Badges!

Check out our new profile badges recognizing authored solutions!

New Power Super Users

Congratulations!

We are excited to announce the Power Apps Super Users!

Power Apps Community Call

Power Apps Community Call: February

Did you miss the call? Check out the Power Apps Community Call here.

Microsoft Ignite

Microsoft Ignite

Join digitally, March 2–4, 2021 to explore new tech that's ready to implement. Experience the keynote in mixed reality through AltspaceVR!

Top Solution Authors
Top Kudoed Authors
Users online (31,890)