Appian Community and Appian Academy are being upgraded. As a part of the upgrade, Appian Community is currently in read-only mode, and user registration is disabled until August 3. We apologize for any inconvenience this may cause, but a more secure, stable, and performant Community experience is coming soon!
The new Appian Community launches August 3, followed by Appian Academy on August 7. During the migration, Appian Community Edition, Appian Academy, Documentation, Certifications, Instructor-led Customer Training, Partner Sales Training & Accreditation, and Forum (for Appian Partners and Customers only) will remain available.
Hi, i´m facing a refreshvariable problem, this code call a rule caled rule!slc_obtenerPolizas(idSiniestro: ri!siniestro.idSiniestro)
local!refrescarPolizas: false, /*REGLA QUE OBTIENE LAS POLIZAS*/ /*Y COBERTURAS*/ local!polizas: a!refreshVariable( value: rule!SLC_obtenerPolizas(idSiniestro: ri!siniestro.idSiniestro), refreshOnVarChange: local!refrescarPolizas ),
rule expression is this:
a!localVariables( local!polizas: rule!SLC_GetObtenerPolizasByDeclaracionID(idSolicitud: ri!idSiniestro).data, local!ramos: a!forEach( items: local!polizas, expression: a!update( fv!item, "ramos", rule!SLC_GetObtenerCoberturaByPolizaID(idPoliza: fv!item.idSiniestroPoliza).data ) ), local!ramos )
which call a two api, we cast json into CDT.
a!localVariables( /* 1. First, configure the integration object to return successfully */ local!integrationResponse: a!refreshVariable( value: rule!CT_SLC_getCoberturaConsultarxPolizaID( idPoliza: ri!idPoliza, usuario: loggedInUser() ), refreshAlways: true ),
Even local!refrescarPolizas is changing value by button, my rule rule!SLC_obtenerPolizas is not refreshing.
I tried using unconvetional code like:
local!polizas: if( local!refrescarPolizas, rule!SLC_obtenerPolizas(idSiniestro: ri!siniestro.idSiniestro), rule!SLC_obtenerPolizas(idSiniestro: ri!siniestro.idSiniestro) ),
and it works, however i wanna know why my refreshvariable is not working. Thanks in advance for your reply
Discussion posts and replies are publicly visible
I covered variable refresh in my recent blog post: https://appian.rocks/2026/05/27/performance-vs-freshness-mastering-arefreshvariable/
refreshOnVarChange fires only when the watched value actually changes. Setting local!refrescarPolizas to true again won't trigger it. Fix by toggling, or better, incrementing a counter.
a!save(local!refrescarContador, local!refrescarContador + 1)