Learn how To Use the Timer Component to Add a Delay before Refreshing the Datasets in the Canvas App.

Vikrant SarodeDyn365CE4 years ago18 Views

In this blog we will learn how to display the loading screen while performing asynchronous call and we will also add a delay before refreshing data so we can see modified data in Canvas App.

Scenario:

In Canvas App while doing asynchronous actions like MS Flow, Third-party API calls, Asynchronous plugin, or background workflows we have a little delay in fetching the modified data from our Data-source.

In my previous blog, I have explained how to invoke HTTP requests from Canvas App to close the opportunity as Won/Lost. Please have a look Blog Link

Solution:

To overcome this issue we can use the Timer component, Using Timer we can add a small delay before refreshing Data-set, by using this small delay we can fetch recently modified data. during this delay we can also display “Loading Screen” popup to users, so that they can understand some background work is in process.

In the below gif, on the 1st page I am displaying a list of opportunities and by selecting one opportunity I am navigating to the opportunity details page. To make it as won I am calling MS Flow on click of “Won” button. As I said it takes some time to process HTTP calls so for that time I display a loading screen for 5 sec and then refresh the data to get recently modified data.

Please follow the below steps to achieve this functionality.

Step 1: Insert “Timer” Component in your Canvas App.

Step 2:  Setup below properties of Timer component.

  • Duration: Set the timer duration as per your requirements, in my case it is 5000 Milliseconds (5 seconds).
  • Start: As the name suggests using this property you can start your Timer, As this is Boolean type so initiate variable “StartTimer, and by making this true/false we will start/end our Timer.
  • OnTimerStart: Using this property we can perform our actions on the start of the timer, this is also a Boolean type, so initialize one more variable “DisplayLoadingScreen” and set value as “true”. We will use this variable to display our Loading screen.
  • OnTimerEnd: On End of the timer we will refresh our Dataset and we will make both our variables (DispalyloadingScreen & StartTimer) false so that our loading screen will be hidden and the Timer will be reset so we can use it multiple times.

Step 3: Now we need one loading screen image, just navigate to Media and select “Image” as shown below.

Step 4: Add loading GIF file from your local machine. (you can download any related Image from internet)

Step 5: Set the visible property of the image as a “DisplayLoadingScren” variable. Based on the variable value it will be displayed or hidden.

Step 6: As we are calling our Power Automate (MS Flow) on click of the Won button, start the timer at the same time. Set StartTimer variable value as True using this formula “Set(StartTimer, true)” and Timer will get a start. As soon as it starts our loading image will be displayed.

All set. Now on the specific action you will get a loading screen and after a while the form will bet refreshed with modified data.

Check out related blog post:

  1. Automate Microsoft’s Teams Meetings using Custom Connector in Power Automate.
  2. SharePoint Integration with Dynamics 356 using Power Automate.
  3. Dynamics CRM No-Code Low-Code Integrations using Power Automate (MS FLOW)
  4. Programmatically Create the Team’s Meeting.
  5. Invoke Power Automate on Creation of New Users in Azure AD
  6. Audit History Using Azure Function

Original Post https://vikrantsdynamicsblogs.wordpress.com/2020/06/28/learn-how-to-use-the-timer-component-to-add-a-delay-before-refreshing-the-datasets-in-the-canvas-app/

Leave a reply

Join Us
  • X Network2.1K
  • LinkedIn3.8k
  • Bluesky0.5K
Support The Site
Events
March 2025
MTWTFSS
      1 2
3 4 5 6 7 8 9
10 11 12 13 14 15 16
17 18 19 20 21 22 23
24 25 26 27 28 29 30
31       
« Feb   Apr »
Follow
Sign In/Sign Up Sidebar Search
Popular Now
Loading

Signing-in 3 seconds...

Signing-up 3 seconds...