Select to view content in your preferred language

automatic refresh not working for ArcGIS instant app/ dashboard through embeded code widget in Experience Builder

713
1
08-03-2023 09:42 AM
Jelle_Stu_PR
Occasional Contributor II

In Experience Builder (ArcGIS Enterprise 10.9.1) I try to add an ArcGIS instant app (minimalistic) through a  embeded code widget. I do it through embeded code because I want to add a automatic refresh on the embeded website. It turns out that the instant app loads correctly once in the experience through the embeded code, but does not refresh anymore through the automatic refresh. I have tried to achieve the same using an ArcGIS Dashboard as embeded code but I get the same behaviour.

The automatic refresh does work when I embed a rondom non-ArcGIS website. 

Is it expected behaviour that ArcGIS web apps/dashboard do not refresh automatically in Experience Builder when the automatic refresh is set up through an embeded code widget?

The reason why I want to embed an instant app/dashboard is because the web map includes a Sketch layer which I want to be updated automatically in my Experience Builder. I realise that if  I would use a feature layer I could add a map through the map widget and from there set up a refresh interval on the feature layer (in the web map itself or in Experience Builder). But it is the Sketch Layer that needs to be updated automatically. In the web map I cannot set up an refresh interval for that. 

Looking forward in your ideas and thoughts.

best,
Jelle Stuurman

0 Kudos
1 Reply
Jelle_Stu_PR
Occasional Contributor II

I came with a workaround by adding a JavaScript snippet to the embeded code.

 

<iframe ...></iframe>
<script>
    const refreshInterval = 600; // seconds
    function reloadIframe() {
        const iframe = document.querySelector('iframe');
        iframe.src=iframe.src;
    }
    setInterval(reloadIframe, refreshInterval * 1000);
</script>
0 Kudos