Hi Everyone,
I am quering the data from table and stroing it into local variable. On button click I am refreshing the data using refresh varibale parameter refreshonvariablechange , but the variable gets changed and data is not refreshing. Could you please help me out?
Discussion posts and replies are publicly visible
This only works in interface objects, not in expression rules.
docs.appian.com/.../fnc_evaluation_a_refreshvariable.html
Hi Laurens, Please suggest how to fix this?
Can you please share your code or provide a screen shot for a better understanding here
This would require us to know some more information on your specific use case and the exact problem that you are facing therein.
Here is snippet, I am refreshing variable local!getAssignee on click of button where on success I am updating refreshcount variable.
button
expression rule
Strip all the refreshvariable logic (especially in the expression rule) for now and read the documentation on it first to understand its behaviours.
https://docs.appian.com/suite/help/22.4/Local_Variables.html#configuring-refresh-behavior
To achieve your desired result just execute the expression you want in the value parameter of an a!save that results from your a!startprocess.
I actually just answered this exact same thing for someone else several days ago. Basically you should pass in your Refresh Counter Variable to your expression rule and use it there with "refreshOnVarChange". You shouldn't set "refreshAlways" in a query like this AFAIK, because if it works it'll cause the query to re-run every single time the user touches anything in the parent interface (i'm unclear whether it's not working for you or whether it's just working so fast you don't notice, but either way...)
Detailed instructions can be found in my comment over here: community.appian.com/.../106000
Laurens Weijzig said:just execute the expression you want in the value parameter of an a!save that results from your a!startprocess.
FYI i steer away from recommending that people simply repeat queries all over the place (presuming that they also need the same query for the same local variable run initially). The power of "update chaining" should allow this to be completely sidestepped these days. In the old days having to copy/paste the same query expression in multiple different SaveIntos all on the same form was the only way to do certain things, but in terms of maintenance and troubleshooting it's an absolute nightmare. With the power of RefreshVariable functionality these days there should be no need.
The only time I'd recommend this query be in the output saveInto as you say is if that's the *only* context on the form in which that query is needed (i.e. if it's not even needed in the initial local variable declaration, which for this specific example, i'll admit i'm not 100% clear on).