Select to view content in your preferred language

Dashboards That Pop: Refresh Intervals

5936
3
09-20-2024 06:43 AM
JenniferAcunto
Esri Regular Contributor
4 3 5,936

Refresh intervals are the hidden heroes of real-time dashboards. Refresh intervals determine how often the operational layer updates and how often elements in your dashboard that use the map as their data source update while the dashboard is open. 

Here I have a dashboard with the same layer used in 2 different maps and indicators, one set with a refresh interval set, and one without. Let’s see what happens when I add a new point. 

 Dashboard elements with and without a refresh interval.Dashboard elements with and without a refresh interval.

What should the interval be? 

Consider how frequently the data is being updated. If your dataset updates daily, there is no reason for your refresh interval to be set at every minute. If the layer has a maximum cache age applied, the cache age determines the shortest interval allowed for refreshing a layer.  

💡Note that the maximum cache age doesn’t prevent you from selecting a shorter refresh interval, however, this can result in unexpected behavior in the dashboard. If your map isn’t updating correctly, be sure to check that the refresh interval is greater than the maximum cache age.  

 

Setting a Refresh Interval 

There are a few different places where you can set various refresh intervals. Let’s look at each one individually.  

Map 

Select the layer in your webmap and open the Properties pane.  

Toggle on the refresh interval and set a value (in minutes). 

  • .5 = 30 seconds 
  • 1 = 1 minute 
  • 60 = 1 hour 
  • 1440 = 1 day 

Properties > Refresh intervalProperties > Refresh interval

 

The layer has a maximum cache age of .5, so I’ve set the refresh interval slightly above (.6) that age.  

In ArcGIS Dashboard, you can bring in data layers from the map or as stand-alone layers. If you set a refresh interval in the map, it will ONLY be applied to widgets in the dashboard that are using the layer from that specific map. This is an important distinction that I see folks get confused with. 

One layer. Two different dashboard sources.One layer. Two different dashboard sources.

 

Here are two different indicators using the same data layer. One is coming from a map with a refresh interval, the other is added as a stand-alone layer.

Same layer. Different refresh settings.Same layer. Different refresh settings.

 

The nice thing about this method is that you can set this for layers you don’t own.  

Layer 

Navigate to your layer’s Item Details page.  

Go to the Visualization tab. 

Ensure the layer is selected and open the Properties pane. 

Toggle on the refresh interval and set a value (in minutes). 

Save. 

Visualization > Properties > Refresh intervalVisualization > Properties > Refresh interval

 

The nice thing about setting it here at the layer level is that every time someone uses this layer, that refresh interval is already set. I can bring this layer into my dashboard as a stand-alone layer and have it automatically refresh.  

The downside is that you can only set this for layers you own or have permission to update. 

Adding a refresh interval to our stand-alone layer.Adding a refresh interval to our stand-alone layer.

Data Expressions 

So what happens if you use a layer with a refresh interval in a data expression? Does that refresh interval trickle down?  

Data expression using a layer with a refresh interval.Data expression using a layer with a refresh interval.

 

It does not. You will need to set the refresh interval in your data expression as well.  

In the Data Expression Arcade editor, there is a refresh interval located next to the name box. 

Data Expression Refresh IntervalData Expression Refresh Interval

 

Data expression with refresh interval.Data expression with refresh interval.

 

Arcade Advanced Formatting 

The Arcade Script Refresh Interval is a bit different than the others. Instead of ensuring that our dashboard data is up to date, it ensures that the Arcade expression is executed at specific intervals.  

Your Arcade expressions will execute when your dashboard data refreshes, so in most cases it is not necessary to also set a script refresh interval. The most common reason to set this is if your Arcade is using the Now() function. 

Using Now() with and without a script refresh interval.Using Now() with and without a script refresh interval.

 

The list on the left checks to see what time it is now when the data is refreshed. Then it just holds that now value until the next time the data or dashboard is refreshed. The list on the right, however, has a script refresh interval set to .1. Which means every 6 seconds it is updating that now value.  

 

Dashboards That Pop

Happy Dashboarding!

3 Comments
MappyIan
Frequent Contributor

Hey @JenniferAcunto, great article and really helpful to something we're creating at the moment to show live occupancy of libraries.  One thing you don't mention in your blog post is the 'refresh script' setting that is found if you enable the Advanced Formatting option on an Indicator Widget:

AGOL Dashboard refresh script.png

 

I created a Dashboard which used a standalone table as it's data source (not in a map).  Tables don't have a 'Visualisation' tab, so I couldn't set the refresh rate on the item itself.  I'm not using a Data Expression, so I couldn't set the refresh rate there either.  The 'refresh script' toggle was the only place I found where I could set some sort of refresh value.  But toggling this one, and setting the refresh to 0.1 minutes didn't do anything.  The data in the Dashboard never updated.  I ended up having to put the table in to a map, and set the refresh interval on the table in the map.  This works fine, and the Dashboard now updates, but I'm confused as to what the 'Refresh script' control is meant to do.  I'm wondering if you could add some clarification about this setting to your blog post as it seems relevant to the topic?

JenniferAcunto
Esri Regular Contributor

That is what is outlined in the blog under the Arcade Advanced Formatting section. That setting just refreshes the arcade, not the data behind it.

MappyIan
Frequent Contributor

Thanks @JenniferAcunto, I can't believe I didn't realise that section was about the 'refresh script' setting [facepalm].  For the scenario I outlined where we have a Dashboard that uses a standalone table is there any way to get the data to refresh without having to add it to a map and set the refresh on there, as this seems a bit redundant?

Contributors
About the Author
I'm a Technical Consultant that focuses on app configuration with a little Geospatial Strategy and Governance thrown in.