I am trying this piece of code but it is just executing while loading the interface and it is never getting refreshed after that.
local!refresh: a!refreshVariable( value: rule!NGS_queryMerGenerationData( executeWhen: true, pagingInfo: a!pagingInfo(startIndex: 1, batchSize: - 1) ) , refreshInterval: 0.5 )
Can you please help regarding this?
Discussion posts and replies are publicly visible
Does that expression use local variables? If yes, you need to add a refresh always inside that expression.
no, the expression doesn't use local variables.
Can you share that code?
rule!NGS_queryEntity( dataStoreEntity: cons!NGS_DSE_MER_GENERATION, returnType: {'type!{urn:com:appian:types:NGS}NGS_merGeneration'()}, executeWhen: ri!executeWhen, queryLogicalExpression: a!queryLogicalExpression( operator: "AND", filters: { a!queryFilter( field: "merType", operator: "=", value: ri!merType ), a!queryFilter( field: "processStatus", operator: ">=", value: ri!processStatus ) }, ignoreFiltersWithEmptyValues: true ), pagingInfo: ri!pagingInfo, fetchTotalCount: true)
OK, and what about this "NGS_queryEntity"? Any local variables in there?
a!localVariables( local!fetchTotalCount: if( rule!NGS_isBlank(ri!fetchTotalCount), false, ri!fetchTotalCount ), local!query: if( or( isnull(ri!dataStoreEntity), not(or(ri!executeWhen)), isnull(ri!pagingInfo) ), null, a!queryEntity( entity: ri!dataStoreEntity, query: a!query( selection: if( rule!NGS_isBlank(ri!fieldList), null, a!querySelection( columns: a!forEach( items: ri!fieldList, expression: a!queryColumn(field: fv!item) ) ) ), aggregation: ri!queryAggregation, logicalExpression: ri!queryLogicalExpression, filter: ri!queryFilter, pagingInfo: ri!pagingInfo ), fetchTotalCount: local!fetchTotalCount ) ), if( rule!NGS_isBlank(ri!returnType), local!query, cast(typeof(ri!returnType), local!query.data) ))
There is a local variable. Thanks for the reply. Let me try it
Found it! You will have to add a refreshVariable with refreshAlways=true
I have tried without using local variables like the following, yet the value is not getting refreshed:
a!refreshVariable( value: cast( typeof( { 'type!{urn:com:appian:types:NGS}NGS_merGeneration'() } ), a!queryEntity( entity: cons!NGS_DSE_MER_GENERATION, query: a!query( pagingInfo: a!pagingInfo(startIndex: 1, batchSize: - 1) ), fetchTotalCount: true ).data ) refreshAlways: 0.5 )
refreshAlways needs to be true. The value (0.5) which you have passed is a valid value for refreshInterval
I do not understand. What did you do, and where?
I was asking you to add a refreshVariable with refreshAlway=true to local!query inside NGS_queryEntity