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 / Spinner Control with C...
Power Apps
Answered

Spinner Control with Changing messages

(0) ShareShare
ReportReport
Posted on by 160
Hello,

Is it possible to show a spinner where the spinner message changes as each action is taking place.
 
For example, I have a Submit button that does several things and is somewhat slow. I show a spinner that says "Loading Data" but I would like it to update its message while it's working.

So for my submit button it would say
  • Recording Action Record
  • Recording Stakeholders
  • Making a system note
  • Creating Action Report repository
Is this possible without slowing things down too much more?

Note: I think it is running slow because I have it calling a Power Automate flow to create a folder in a library.
Categories:
I have the same question (0)
  • Verified answer
    Dhanush Pamarthi Profile Picture
    24 on at

    Hi,

     

    Yes, you can show a spinner with a changing message, but there is one limitation: if all actions are running inside one long OnSelect formula, Power Apps may not visually update the spinner text between each step until the formula finishes.

    A better approach is to use a variable for the spinner text and update it before each major action.

    Example:

    Set(varShowSpinner, true);
    Set(varSpinnerMessage, "Recording Action Record");
     
    Patch(
        'Action Records',
        Defaults('Action Records'),
        {
            Title: txtTitle.Text
        }
    );
     
    Set(varSpinnerMessage, "Recording Stakeholders");
     
    Patch(
        Stakeholders,
        Defaults(Stakeholders),
        {
            Title: txtStakeholder.Text
        }
    );
     
    Set(varSpinnerMessage, "Making a system note");
     
    Patch(
        'System Notes',
        Defaults('System Notes'),
        {
            Note: "Action created"
        }
    );
     
    Set(varSpinnerMessage, "Creating Action Report repository");
     
    YourFlow.Run();
     
    Set(varShowSpinner, false);
     
    Notify(
        "Process completed successfully",
        NotificationType.Success
    );

    Then set your spinner/label properties like this:

    Spinner Visible

    varShowSpinner

    Spinner message Label Text

    varSpinnerMessage

     
     

    Important note

     

    This may work to some extent, but if the submit button is doing everything in one continuous formula, Power Apps may not always repaint the screen between steps. So the message might not appear to change smoothly.

     

    If you need the message to definitely update step-by-step, a better design is to use a Timer control or split the process into stages.

     
     

    Better approach using a Timer

    You can use variables to control the current stage.

    Submit button OnSelect

    Set(varShowSpinner, true);
    Set(varSubmitStep, 1);
    Set(varSpinnerMessage, "Recording Action Record");
    Set(varStartSubmitTimer, true);

    Timer properties:

    Set the Timer:

    Duration = 100
    Repeat = false
    AutoStart = varStartSubmitTimer

    Timer OnTimerEnd:

    Switch(
        varSubmitStep,
     
        1,
        Set(varSpinnerMessage, "Recording Action Record");
        Patch(
            'Action Records',
            Defaults('Action Records'),
            {
                Title: txtTitle.Text
            }
        );
        Set(varSubmitStep, 2);
        Reset(tmrSubmit);
        Set(varStartSubmitTimer, false);
        Set(varStartSubmitTimer, true),
     
        2,
        Set(varSpinnerMessage, "Recording Stakeholders");
        Patch(
            Stakeholders,
            Defaults(Stakeholders),
            {
                Title: txtStakeholder.Text
            }
        );
        Set(varSubmitStep, 3);
        Reset(tmrSubmit);
        Set(varStartSubmitTimer, false);
        Set(varStartSubmitTimer, true),
     
        3,
        Set(varSpinnerMessage, "Making a system note");
        Patch(
            'System Notes',
            Defaults('System Notes'),
            {
                Note: "Action created"
            }
        );
        Set(varSubmitStep, 4);
        Reset(tmrSubmit);
        Set(varStartSubmitTimer, false);
        Set(varStartSubmitTimer, true),
     
        4,
        Set(varSpinnerMessage, "Creating Action Report repository");
        YourFlow.Run();
        Set(varSubmitStep, 5);
        Reset(tmrSubmit);
        Set(varStartSubmitTimer, false);
        Set(varStartSubmitTimer, true),
     
        5,
        Set(varShowSpinner, false);
        Set(varStartSubmitTimer, false);
        Notify(
            "Process completed successfully",
            NotificationType.Success
        )
    )

    This gives Power Apps a chance to update the UI between each step.

     
     

    About the Power Automate flow

     

    Since you mentioned the slowness may be due to the flow creating a SharePoint folder, that is very possible. Calling a flow from Power Apps can slow down the user experience because the app waits for the flow response.

    If possible, consider:


    • only calling the flow once

    • moving more related actions into the same flow

    • returning a simple success/failure response to Power Apps

    • creating the SharePoint folder asynchronously if the user does not need it immediately


    •  
     
     

    Recommended solution

    For a simple app, use:

    Set(varSpinnerMessage, "message here")

    before each action.

    But for a more reliable step-by-step spinner message, use the Timer-based approach, because it allows the screen to refresh between actions.

    Hope this helps.

    If this helped solve your issue, please Accept as Solution so others can find it quickly.
    If it didn’t fully solve it but was still useful, please click “Yes” on “Was this reply helpful?” or leave a Like :).
     

  • Suggested answer
    11manish Profile Picture
    3,333 on at
    For most scenarios:
    • Use a spinner popup with a status label.
    • Move as much processing as possible into a single Power Automate flow.
    • If you need changing messages, use the Timer-based sequential approach or a status table updated by the flow.
    Also, creating SharePoint folders through Power Automate is often one of the slower operations. If the folder is not required immediately, consider creating it asynchronously after the user submission completes, which can significantly improve perceived performance.
  • FW-07051511-0 Profile Picture
    160 on at
    @Dhanush Pamarthi

    I will work through you suggestions. I already have the flow passing back a success with a value needed for a patch action.
  • Suggested answer
    McPowerPlatform Profile Picture
    52 on at

    If you don't mind, I'd like to share a simple solution that worked well for me.

    1. Add an Image Control

    Insert an Image control and make sure it is positioned above all other controls so it acts as an overlay.

    2. Size the Image to Cover the Entire Screen using this code on the image properties :
    Width = App.Width Height = App.Height

    3. Show and Hide the Loading Overlay, In the button (or any control) that triggers the process, use context variables to display a loading message and spinner while your code runs:

    UpdateContext({txtMessage: "Loading..."});
    UpdateContext({showSpinner: true});
    // Your code...
    // Your code...
    // Your code...
    UpdateContext({showSpinner: false});
    UpdateContext({txtMessage: ""});
     
    4. For the Image  Use this code on the Image property:
    "Data:image/svg+xml,"
    &
    EncodeUrl($"
    <svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 {Self.Width} {Self.Height}' width='{Self.Width}' height='{Self.Height}' >
    <rect width='{Self.Width}' height='{Self.Height}' fill='rgba(16,46,67,.7)' x='0' y='0'/>  
    <text x='50%'  y='50%' fill='#ffffff' font-size='32' font-weight='bold' text-anchor='middle' font-family='Arial, Helvetica, sans-serif' >
        <tspan  text-anchor='middle' filter='drop-shadow(1 1 2px #084156)' >{txtMessage}</tspan>
        <animate attributeType='XML'
                attributeName='fill-opacity'
                values='0;1'
                dur='0.8s'
                repeatCount='indefinite'/>
        </text>
    <circle cx='50%' cy='50%' r='220' fill='none' stroke='rgba(229,231,235,.5)' stroke-width='32'></circle>
    <circle cx='50%' cy='50%' r='220' fill='none' stroke='#ffff' stroke-width='32' stroke-dasharray='1382.30' stroke-dashoffset='1382.30'>
    <animate attributeName='stroke-dashoffset' values='1382.30;0' dur='2s' repeatCount='indefinite'></animate>
    </circle>
    </svg>")
     
    5.Set the Visible property of the image using the variable : showSpinner
     
    This creates a full-screen loading overlay with a semi-transparent background, a customizable message, and an animated spinner. It's lightweight, easy to implement, and works reliably across different screens and processes.

    Hope this new approach can help you, let me know how this works


     
    postcomm01.png

    Your file is currently under scan for potential threats. Please wait while we review it for any viruses or malicious content.

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

Jump in, show your community spirit, and win prizes!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the May Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
Valantis Profile Picture

Valantis 424

#2
WarrenBelz Profile Picture

WarrenBelz 355 Most Valuable Professional

#3
11manish Profile Picture

11manish 290

Last 30 days Overall leaderboard