On initialize event
Application Type

Is there any way to show loader for 5 sec on "On initialize" event  ??

If you want to show the loading spinner you can create a boolean 'ShowSpinner' and put the default value on True. Assign the ShowSpinner variable to the 'Visibile' property of the container that holds the Loading icon. the default value will be true so the spinner will be visible until you change the value of the 'ShowSpinner' boolean to False.

hope this helps 

Already tried still not working as i m expecting.

Can you explain the issue in detail?
What i understand from you post now is that you would like to have a loading icon visible when opening your webpage until certain data is ready?


In addition to the above solution given by @Thibaut G 

Use sleep from forge, and set its time '5 sec' after that sleep action make the Boolean false.

Implement this on you 'OnInitialize' action.

Sleep Forge



Hello Anees,

Sleep is a server action, this is not a best practice to call server action on On initialize.

hey guys,

@Asiyah Munawwar , you need to tell us why you want this, what is the spinner for, when is it ok to stop spinning ?  What problem do you have without that spinner, that you want the spinner to solve ? 

Depending on your answer, you will probably look at using the IsFetched or the OnAfterFetch of an aggregate or DataAction, but that's me just guessing. Maybe your use case is different.

@others, he is asking about OnInitialize, the first render of the screen only happens AFTER OnInitialize, so no solution in there will show a spinner.


Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.