Hi everyone,
I'm having a grid field that shows data from a process model based report by using a!queryProcessAnalytics() query. I set up a manual refresh button that updates a reference local variable's value (local!refreshCounter), so that whenever user clicks the refresh button, the report value will be updated if there is any new active process task.
However, the process was not refresh unless I refresh the whole page (F5).
I'm I doing it wrong?
a!localVariables( local!refreshCounter: 1, local!datasubset: a!refreshVariable(value: a!queryProcessAnalytics( report: <Report to query from>, contextProcessModels: <process model that report gets data from>, query: a!query( pagingInfo: a!defaultValue(ri!pagingInfo,a!pagingInfo(1,-1)), logicalExpression: a!queryLogicalExpression( operator: "AND", logicalexpressions: { a!queryLogicalExpression( operator: "AND", ignorefilterswithemptyvalues: true, filters: /*Status */ a!queryFilter( applyWhen: and(a!isNotNullOrEmpty(ri!statusFilterOperator), a!isNotNullOrEmpty(ri!statusFilterValue)), field: "c1", operator: ri!statusFilterOperator, value: ri!statusFilterValue ) ) }, ignorefilterswithemptyvalues: true ) ) ), refreshOnVarChange: local!refreshCounter), local!reportData: { startIndex: local!datasubset.startIndex, batchSize: local!datasubset.batchSize, sort: ri!pagingInfo.sort, totalCount: local!datasubset.totalCount, identifiers: local!datasubset.identifiers, data: a!forEach(local!datasubset.data,cast( typeof('type!{urn:com:appian:types:'()), fv!item) ), columnConfigs: local!datasubset.columnConfigs }, {a!buttonArrayLayout( align: "END", buttons: { a!buttonWidget( label: "", tooltip: "Refresh", size: "SMALL", color: "ACCENT", icon: "refresh", style: "GHOST", saveInto:{ a!save(local!refreshCounter,local!refreshCounter + 1) } ) } ), a!gridField( pagingSaveInto: a!save(local!refreshCounter,local!refreshCounter + 1), borderStyle: "STANDARD", initialSorts: a!sortInfo(field: "c1",ascending: true), label: "Process Tasks", emptyGridMessage: "No Active Process", labelPosition: "COLLAPSED", data: local!reportData.data, columns: { } )
Discussion posts and replies are publicly visible
It looks like the a!refreshVariable is set up correctly, but a!queryProcessAnalytics has always had weird behaviors so it doesn't surprise me if it's not working as expected. What happens if you update the saveInto on your button to do a!save(local!datasubset, a!queryProcessAnalytics(...))?
Dan Lluhi : I just tried with test process report. Please check below image
Interface:
Expression:
Dan Lluhi said: What happens if you update the saveInto on your button to do a!save(local!datasubset, a!queryProcessAnalytics(...))?
That would technically work as a manual approach but definitely defies the update convention enabled in Refresh Variables (by setting manual refresh targets etc).
I actually have an interface configured exactly like OP's and as far as I know it works fine.
Agreed it should work fine as is, I was more curious about the updated saveInto as a troubleshooting step. If it works correctly with the updated saveInto then that indicates an issue with the refreshVariable, but if this also does not refresh the query then something else is wrong
Ah, then yes I agree, it would be useful to see if the behavior is any different with that approach.