Site Page title with a!refreshVariable

I have inserted the following piece of code in order to show always the updated number of available tasks to the users.

=a!localVariables(
 local!report: a!refreshVariable(
  value: a!queryProcessAnalytics( 
   report: cons!IOC_USER_TASK_REPORT,
   contextProcessModels: {
    cons!IOC_PROCESS_MODEL_NOTIFICATIONS
   },
   query: a!query(
    pagingInfo: a!pagingInfo(startIndex: 1, batchSize: 1000),
    filter: a!queryFilter(
     field: "c1",
     operator: "<>",
     value: 2 
   )
  )
 ),
 refreshInterval: 0.5
),
"Workflows (" & length(
local!report.data
) & ")"
)

Sadly enough, the automatic refreshing is not working at all. Is this an expected behavior or there is something wrong with this code?

I am running on Appian Cloud 19.2

  Discussion posts and replies are publicly visible

Parents
  • +1
    Certified Lead Developer

    2 things:

    1. this code would only work in an Interface, not an expression used elsewhere (as mentioned by previously).  If you look up the documentation for a!refreshVariables, it tells you that all optional parameters are ignored when used outside of the context of an interface, which would include the refresh interval.
    2. Even if you are using an interface, I discovered a bug (which still hasn't been fixed apparently) where, in the Interface Editor specifically, an auto-refreshing variable won't auto-refresh at all if it's either the ONLY local variable, or the FIRST local variable declared.  If the only local variable you need is the auto-refreshing one, then to get it to apparently work correctly within Interface Editor you should define a "spare" local variable before the auto-refreshing one.
Reply
  • +1
    Certified Lead Developer

    2 things:

    1. this code would only work in an Interface, not an expression used elsewhere (as mentioned by previously).  If you look up the documentation for a!refreshVariables, it tells you that all optional parameters are ignored when used outside of the context of an interface, which would include the refresh interval.
    2. Even if you are using an interface, I discovered a bug (which still hasn't been fixed apparently) where, in the Interface Editor specifically, an auto-refreshing variable won't auto-refresh at all if it's either the ONLY local variable, or the FIRST local variable declared.  If the only local variable you need is the auto-refreshing one, then to get it to apparently work correctly within Interface Editor you should define a "spare" local variable before the auto-refreshing one.
Children