cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
anotherlama
Level: Powered On

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
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
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

TopShelf-MSFT
Level 10

Re: Refresh variable before displaying it in text box

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

 

@TopShelf-MSFT 

Helpful resources

Announcements
thirdimage

Power Automate Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

sixthImage

Power Platform World Tour

Find out where you can attend!

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

fifthimage

Microsoft Learn

Learn how to build the business apps that you need.

Top Kudoed Authors (Last 30 Days)
Users online (5,548)