Question
Refresh a!queryProcessAnalytics() when changing referenced variable not working
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: ,
contextProcessModels: ,
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: {
}
) 