web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Loading spinner when d...
Power Apps
Unanswered

Loading spinner when data are been patched?

(0) ShareShare
ReportReport
Posted on by 997

Hello,

I think this is a standard question from everyone, but

I use a timer, but seems when taking to long for the patching, the timer has already ended but still busy with patching

Even i use without a timer and set in on the patching line, same result

The spinner disappear but patching still busy.

How can i fix that?
My code without timer is

 

Set(
 varLoadingData;
 true
);;
If(
 Connection.Connected;
 IfError(
 Patch(
 SharepointData;
 LookUp(
 SharepointData;
 ID = Gallery3_2.Selected.ID
 );
 {
 TYPE: "SEND";
 UPDATEDATE: Text(
 Now();
 "[$-en-EN]d-m-yyyy"
 );
 USER: Left(
 MyUserName;
 Find(
 " ";
 MyUserName
 )
 )
 }
 );
 Set(
 ShowAccessError;
 true
 );;
 Set(
 varLoadingData;
 false
 );;
 Set(
 varError;
 FirstError.Message
 );
 Reset(Gallery3_2);;
 Refresh(SharepointData);;
 Set(
 varLoadingData;
 false
 )
 );
 Set(
 varNoconnection;
 true
 );
 Set(
 varLoadingData;
 false
 )
)

 

 

My timer code is
OnTimerEnd
Set(varLoadingData;false)

AutoStart
varLoadingData

Duration

5000 (changed many times, but won't to take to long because when the patched has been done, i don't want to show the spinner anymore for nothing)

 

thank you

Categories:
I have the same question (0)
  • ANB Profile Picture
    7,223 Super User 2025 Season 2 on at

    Hi @TimmyBoy , Correct me if I am wrong. Your spinner got invisible and the patch is still going on in background? If yes, then below variable should be declared out of the if condition.

     

     

     

    Set(
     varLoadingData,
     false
    )

     

     

     

    Just try this:

     

     

     

    Set(
     varLoadingData,
     true
    );
    
    Your if code.........
    
    Set(
     varLoadingData,
     false
    )

     

     

     

    And of course your spinner visible property would be varLoadingData.

     

    Also make sure to remove  Set(varLoadingData,false) from middle of the code:

     

    ANB_0-1696612440051.png

    And timer would not require.

    -----------------------------------------------------------------------------------------------------------------------------
    I hope this helps.


    Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs up.

    Thanks,
    ANB

     

  • TimmyBoy Profile Picture
    997 on at

    Hi @ANB 

    Yes the dots keep showing when patching is busy

    I have remove all the varLoadingData

    But same result

    Set(
     varLoadingData;
     true
    );;
    If(
     Connection.Connected;
     IfError(
     Patch(
     SharepointData;
     LookUp(
     SharepointData;
     ID = Gallery3_2.Selected.ID
     );
     {
     TYPE: "SEND";
     UPDATEDATE: Text(
     Now();
     "[$-en-EN]d-m-yyyy"
     );
     USER: Left(
     MyUserName;
     Find(
     " ";
     MyUserName
     )
     )
     }
     );
     Set(
     ShowAccessError;
     true
     );;
     Set(
     varError;
     FirstError.Message
     );
     Reset(Gallery3_2);;
     Refresh(SharepointData)
     );
     Set(
     varNoconnection;
     true
     )
    
    );;Set(
     varLoadingData;
     false
     )
  • Verified answer
    ANB Profile Picture
    7,223 Super User 2025 Season 2 on at

    Hi @TimmyBoy , Please check that varLoadingData is getting set anywhere else on the app. This happen when you use global variable and that global variable is also declared on some controls OnChange property.  So, instead use 

     

    UpdateContext({var_Loading:true}); 
    
    if code.....
    
    UpdateContext({var_Loading:false}); 

     

    And use var_Loading on visible property of spinner.

     

    -----------------------------------------------------------------------------------------------------------------------------
    I hope this helps.

    Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs up.

    Thanks,
    ANB

  • TimmyBoy Profile Picture
    997 on at

    Hi @ANB 

    Not sure but,

    I used your example 

    var_Loading


    But same result

    The spinner hide before ending patching 😞

     

    UPDATE: okay, it seems the spinner stays a little longer, but still ends before patching

  • ANB Profile Picture
    7,223 Super User 2025 Season 2 on at

    Hi @TimmyBoy This is strange. Can you confirm when you say spinner, does that mean you have added some gif on image control?

     

    UpdateContext should work. For above code: It should be Set(varLoadingData,false) not Set(varLoadingData;false). You are using ';' and it should be comma.

     

    Thanks,

    ANB

     

  • TimmyBoy Profile Picture
    997 on at

    Hi @ANB 

    No, i use a container with inside a label that says PLEASE WAIT..
    And on the visible part 

    var_Loading

     Yes i'm aware i using ; instead of ,

    Because my computer has an other language and don't accept the ,

     

  • TimmyBoy Profile Picture
    997 on at

    Hi @ANB 

    Thank you for the help

    I fix it, i add this on the timerends

    UpdateContext({var_Loading:!var_Loading})

    And this stays when the data really stops patching.

    Thank you 🙂

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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 796 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 327 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard