cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Helper II
Helper II

Refresh variable before displaying it in text box

Hello! 

On my home screen i am setting "HoursWeek", which calculates the hours at work already conducted this week. It is set at the on visible property of the home screen. It is also displayed on the home screen. However, I am using it a second time. I have a button that starts a flow and adds hours to the sharepoint list. Once the hours are added to the list, the HoursWeek variable should theoretically increase. What i thought of to achieve that: Use Set(HoursWeek;"formula") again. The problem: The push of the button increases the number of hours via flow, navigates to a new site, where the new number of hours should be displayed. I think the navigation is faster than the flow. So once navigated, the on visible property of the new screen set the variable again, but as the flow is not finished yet, it doesnt add the new hours to the numbers. So, the old value of the variable is displayed in the text box of the new screen. What can i do to have the refreshed and updated number displayed? Thanks a lot for your help!

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Super User
Super User

Re: Refresh variable before displaying it in text box

Hi @anotherlama 

When you say that the button naviagates to a new site, do you mean that it navigates to a new screen, or does it navigate to a different app?

If the user remains in the same app, one option would be to update your variable manually before calling your flow...

Set(HoursWeek; HoursWeek + HoursToAdd)

You could then move your orignal Set statement from the OnVisible property of your screen to the OnStart property of your app. That way, your Set statement won't reset HoursWeek to the old value during the navigation.

Another way to do this would be to call Set(HoursWeek;"formula") on a timer. By doing this, the variable would still show the old value following the navigation, but it'll show the new value as soon the Flow completes and the timer code runs.

 

 

View solution in original post

2 REPLIES 2
Highlighted
Super User
Super User

Re: Refresh variable before displaying it in text box

Hi @anotherlama 

When you say that the button naviagates to a new site, do you mean that it navigates to a new screen, or does it navigate to a different app?

If the user remains in the same app, one option would be to update your variable manually before calling your flow...

Set(HoursWeek; HoursWeek + HoursToAdd)

You could then move your orignal Set statement from the OnVisible property of your screen to the OnStart property of your app. That way, your Set statement won't reset HoursWeek to the old value during the navigation.

Another way to do this would be to call Set(HoursWeek;"formula") on a timer. By doing this, the variable would still show the old value following the navigation, but it'll show the new value as soon the Flow completes and the timer code runs.

 

 

View solution in original post

Highlighted
Anonymous
Not applicable

Re: Refresh variable before displaying it in text box

Hi @anotherlama how are you progressing with this? Was the above reply helpful?

 

@Anonymous 

Helpful resources

Announcements
Check this Out

Helpful information

Featuring samples like Return to the Workplace and Emergency Response Applications

August 2020 Community Challenge: Can You Solve These?

August 2020 Community Challenge: Can You Solve These?

We're excited to announce our first cross-community 'Can You Solve These?' challenge!

secondImage

Return to Workplace

Reopen responsibly, monitor intelligently, and protect continuously with solutions for a safer work environment.

secondImage

Super Users Coming in August

We are excited for the next Super User season.

secondImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Top Solution Authors
Top Kudoed Authors
Users online (4,631)