refreshlocal-variablesappian

Automatical update of an Appian webpage on change of task status?


We have an Appian grid that shows all Appian tasks of a user. The corresponding data we obtain using queryProcessAnalytics(). How can we make this update automatically when the task status changes?

Currently, we have stored the result of queryProcessAnalytics() in a local variable and we set a!refreshVariables() to refresh this variable on every "user interaction" with refreshAlways: true. We also added a button Refresh that doesn't store anything away, but simply counts as a user interaction when it is clicked. The grid then refreshes automatically when the local variable with the data changes, because the grid is set to refresh when a used/dependent local variable has changed, which mainly means that the user is forced to click on Refresh to ensure to be up-to-date and see latest tasks.

We consider this a workaround as the refresh automatically on variable change in our understanding triggers refresh of local variable (and thus the grid) only once an another local variable changes, but does not trigger a refresh queryProcessAnalytics would suddenly throw a different result.

Any help towards a fully automatical solution is appreciated!

We searched the Appian community but to no avail. Most entries are rather old, e.g.


Solution

  • You should use refreshInterval within your a!refreshVariables()with value 0,5. It will refresh every 30 seconds. https://docs.appian.com/suite/help/21.3/fnc_evaluation_a_refreshvariable.html