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 / Timing issues with On ...
Power Apps
Answered

Timing issues with On Visible

(1) ShareShare
ReportReport
Posted on by Microsoft Employee

Hi,

In alot of business scenarioes its important to know what values the fields in a Custom SharePoint form had initialy, and then being able to compare it to values once the form is saved. I use this often to fire notification workflows, instead of using the "On modified" Flow trigger.

With designer and classic sharepoint, this was mostly solved by using a hidden log field, and setting the value of this field to the visible field, and then these could be compared in the designer workflow.

With PowerApps and the availability of variables, we can avoid this log field and workflow logic.

This issue i am running into, is that it seems, when using the On visible value to set the variables, the data isnt loaded yet, so the variables stays empty. 

I have solved this with a hidden timer, that waits 2 seconds before setting the variables. This works but I just wanted to know if some else have found a better solution for the timing issues with data sources not loading the data instant on visible.

Categories:
  • v-xida-msft Profile Picture
    Microsoft Employee on at

    Hi @Anonymous ,

    Could you please share a bit more about your issue?

    Do you create a custom form using PowerApps within your SP List?

    Further, do you want to initialize/set a variable when you open a new form (click "+ New" button)?

     

    Based on the issue that you mentioned, I suppose that you created a custom form using PowerApps in your SP List, is it true?

     

    According to the issue that you mentioned, I think this issue may be related to the OnVisible property of the FormScreen.

    If you created a custom form using PowerApps within your SP List, there are some limits on OnStart property and OnVisible property you need to know. The OnStart property and OnVisible proeprty of the FormScreen would be executed only once while the list is loaded.

    In other words, when you load your custom form in your SP List first time, the OnStart property and OnVisible property would be fired. Then when you load the form again to create another new record, the OnStart property and OnVisible property would not be fired again.

    Please check the following article for more details:

    https://docs.microsoft.com/en-us/powerapps/maker/canvas-apps/sharepoint-form-integration#customize-the-default-form

     

    As an alternative solution, you could consider set your variables within the OnNew property of SharePointIntegration control. On your side, please set the OnNew property of the SharePointIntegration control to following:

    Set(Variable1, "value1"); /* <-- Set your variables here. These variables would be set when you load a New Form via clicking "+ New" in your SP List */
    Set(Variable2, "value2");
    ...
    NewForm(SharePointForm1)

    If you want to set variables when you edit a form, please consider set the OnEdit property of the SharePointIntegration control to following:

    Set(Variable1, "value1"); /* <-- Set your variables here. These variables would be set when you edit a form via clicking "+ New" in your SP List */
    Set(Variable2, "value2");
    ...
    EditForm(SharePointForm1)

     

    Please consider take a try with above solution, then check if the issue is solved.

     

    Best regards,

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    Thanks for the suggestion, but unfortunately the same timing issues are still present. If I use View item or use the Edit button diretly in the list(not in the form), the data isnt loaded fast enough and the variable stays blank or on the previously selected item.

     

    Screenshot_2.png
  • Verified answer
    v-xida-msft Profile Picture
    Microsoft Employee on at

    Hi @Anonymous ,

    Do you mean that the variable could not be loaded fast enough in your custom form?

     

    Based on the issue that you mentioned, I have made a test, please consider take a try with the following workaround:

    please set the OnNew property of the SharePointIntegration control to following:

    Set(Variable1, "value1"); /* <-- Set your variables here. These variables would be set when you load a New Form via clicking "+ New" in your SP List */
    Set(Variable2, "value2");
    ...
    Refresh('YourSPList'); /* <-- Add formula here */ NewForm(SharePointForm1)

    If you want to set variables when you edit a form, please consider set the OnEdit property of the SharePointIntegration control to following:

    Set(Variable1, "value1"); /* <-- Set your variables here. These variables would be set when you edit a form via clicking "+ New" in your SP List */
    Set(Variable2, "value2");
    ...
    Refresh('YourSPList'); /* <-- Add formula here */ EditForm(SharePointForm1)

    set the OnView property of the SharePointIntegration control to following:

    Refresh('YourSPList'); /* <-- Add formula here */
    ViewForm(SharePointForm1)

    Please take a try with above solution, then check if the issue is solved.

     

    Best regards,

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    Thanks. It seems the refresh function did fix most of the issue. I can still rapidly click between items to produce the issue, this happens only in viewform, so the following edit button will set the variable correctly. 

     

     

    Screenshot_2.png
  • Verified answer
    v-xida-msft Profile Picture
    Microsoft Employee on at

    Hi @Anonymous ,

    Have you solved your problem?

     

    Actually, the Network state would also affect the execution speed of the functions in PowerApps canvas app. Please make sure your Network is in a good condition.

     

    If you have solved your problem, please go ahead to click "Accept as Solution" to identify this thread has been solved.

     

    Best regards,

  • postandin7 Profile Picture
    4 on at

    Thank you for this. banged on this one way too long, found this and my issue was fixed seconds later. 

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

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 342 Super User 2026 Season 2

#2
M Bilal Khan Profile Picture

M Bilal Khan 258

#3
Mohsin Ali Profile Picture

Mohsin Ali 231

Last 30 days Overall leaderboard