I want the data to get updated in the interface in a site soon after a database operation without refreshing the page. I would like to get suggestions regarding how to implement the same.
Discussion posts and replies are publicly visible
I think your best bet is to use the a!refreshVariable() function inside a!localVariables():
https://docs.appian.com/suite/help/latest/fnc_evaluation_a_refreshvariable.html
This function can refresh the interface on an interval to show changes after a database operation. There are also a few interface patterns that describe how to do this: https://docs.appian.com/suite/help/latest/recipe-refresh-until-asynchronous-action-completes.html
Hi,
I did try using refreshVariable, but it is taking about 30 seconds to change. Is there any other way which we can use so that the changes reflect immediately after the database save?
What method of database save are you referring to? Is it a process model with a Write to Data Store node, or an on-form database save, or something else?
It is a process model with a Write to Data Store Node.
Is the database update initiated by the user on the form or is it a completely asynchronous activity? If it's asynchronous from the interface, then using the refreshVariable is probably your only option. However, if the database update is triggered by the user on the interface, you might be able to use the a!writeToDataStoreEntity() function instead of a process model. This function lets you receive a response from the database with the data written after it completes using the onSuccess parameter. See this page for more information: https://docs.appian.com/suite/help/latest/recipe-use-the-write-to-data-store-entity-smart-service-function-on-an-interface.html