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 ) & ")")
=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
I forgot to say that the code above is in the title section of the site page!
Hi Antonio,
Please give parameter refreshAlways : true() and give a try. I hope it will work.
Thanks
Thanks for the suggestion Rajesh, I tried but it doesn't work anyway...
I Think a!refreshVariable() will work only in interface object
i have tried it,its working in interface but its not working for site tittle
please correct me if i am wrong
2 things:
I understand these limits, although I thought that the page title was some kind of oob interface component. I was wrong
Thanks everyone!
Hi Mike,
Thanks for the info.
Could you please post sample code snippet for the 2nd point you mentioned?
Thanks in advance.
Rajesh Mahenderkar - here you go. In this example, the auto-refreshing variable (when it's the first/only one) will never auto-refresh. However if you un-comment the commented-out "override" local variable above it, and press "test" to start fresh, it will work as expected.
a!localVariables( /* local!override: "testing", */ local!firstVariable: a!refreshVariable( value: now(), refreshInterval: 0.5 /* will never refresh unless/until the local!override variable is un-commented. */ ), a!formLayout( label: "Variable AutoRefresh Test", contents: { a!textField( label: "RefreshTime", readonly: true(), value: text(local!firstVariable, "yyyy/mm/dd hh:mm:ss"), ) } ) )
This does not work
a!localVariables( local!startTime: now(), local!lastUpdated: a!refreshVariable( value: now(), refreshInterval: 0.5 ), { a!textField( label: "Last Updated", value: local!startTime, readOnly: true ), a!textField( label: "Last Updated", value: local!lastUpdated, readOnly: true ) } )
This does work
a!localVariables( local!fixAppianBrokenFunctionality: "Please", local!startTime: now(), local!lastUpdated: a!refreshVariable( value: now(), refreshInterval: 0.5 ), { a!textField( label: "Start Time", value: local!startTime, readOnly: true ), a!textField( label: "Last Updated", value: local!lastUpdated, readOnly: true ) } )
So having a first order local var that is referencing text seems to work whereas referencing now() does not.
Interesting, thanks for making the distinction - I didn't realize that the behavior was different depending on the data type of the initial local variable - I obviously didn't test that robustly after discovering the bug ;-)