Background: In my application there is a simple paging feature that utilizes a server side application to retrieve data for each page of a grid that needs looked at. Upon receiving a response from the server, the onSuccess callback of the startProcess function that is called will use an expression rule which matches the data returned with data found in a view on the appian cloud db. This matching is done in order to alter one column of the data to fill it in with task Ids when one is found in the db for the given data row.
Problem: Creating a new task works great and a task Id will show properly in the grid. Paging works great and existing task Ids will show properly. The issue is found when a user creates a task, navigates to a previous page, and then returns to the page where the task Id was. In this case the task Id will not be found.
Walkthrough:
Scenario 1Navigate to page 3, making previous page page 2create task, task Id showsnavigate to page 2navigate to page 3task Id is gone.
Scenario 2Navigate to page 3, then page 2, making previous page page 3create task, task Id showsnavigate to page 3navigate to page 2task Id is gone.My suspicion is that the use of queryEntity with the same parameters is caching the original output of the query that is used to match server side data with task data in appian. I'm thinking this because of the documentation found here but I'm not sure. a!queryEntity() Function - Appian 21.2
Any insight or advice here would be great. Thanks in advance.
Discussion posts and replies are publicly visible
Hi jacobl825,
I think the issue resides in how we query the data while paging and not with the a!queryEntity() function. In the paging save into, are we executing the query to fetch the task Ids from DB? Could you please share the code here?
I assume you use some local variables in your expression. When you call an expression inside the same interface multiple times, by default the local variable value is not evaluated again. To achieve this, you might want to use a!refreshVariable() and set refreshAlways to true.
This is only relevant for cases where the user stays in the same top-level interface.
Also if you don't want to always refresh, you can create a dummy variable that you only update on page changes (usually I just keep incrementing this variable by 1). Then, you can use the "refreshOnVarChange" parameter in a!refreshVariable() to only refresh withen this variable changes.
Adding refreshVariable refreshAlways:true to every variable worked XDDD
So silly
Thanks all