Hello All,
I have a requirement where user can open the ui and redirects to the url that was mentioned in the ui and can change the data in the new tab.After changing the data. we are giving an buttonwidget in the ui to refresh a variable to know whether data had changed or not. It returns true or false based on the actions done in the different tab.
But the problem I am seeing button is not working as expected.
Below is the codea!buttonWidget( label: "REFRESH", value:ri!refresh, saveInto: { a!save( ri!refresh, rule!SD_IsDataChanged(
)id:ri!id ) },On the above i am getting the data from the database to check data is updated or not and storing in the refresh variable. the problem here is first when user clicked on the refresh , refresh variable is storing the expected value. but later if i change the data and click on the button again it still having the same value. i doubt whether button save is working or not beacuse when i open the actual rule its giving the correct boolean value.What i observed is if ri!refresh had a value already. its not saving again. The thing is i am testing this in normal designer ui. not even in site.
Can someone pls help on this?
Thanks in Advance!! ),
Discussion posts and replies are publicly visible
Do you use any local variables in SD_IsDataChanged? If yes, add a refreshvariable set to refresh always to prevent Appian from caching the value instead of repeating the query.
Caches expression rule results when inputs don't change. Since ri!id never changes, the rule returns cached value every time. Add a dummy refreshCounter input to bust cache:
a!buttonWidget( label: "REFRESH", saveInto: { a!save(ri!refreshCounter, ri!refreshCounter + 1), a!save(ri!refresh, rule!SD_IsDataChanged( id: ri!id, refreshCounter: ri!refreshCounter )) } )
Thanks Stefan Helzle . It worked.