<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="https://community.appian.com/cfs-file/__key/system/syndication/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>Refresh Variable Not Refreshing</title><link>https://community.appian.com/discussions/f/general/39861/refresh-variable-not-refreshing</link><description>I have the following code snippet from an interface expression that is not updating the refresh variables. I have confirmed that local!refresh updates on record action as it is supposed to, but I cannot get local!selected_tasks or local!expired_tasks</description><dc:language>en-US</dc:language><generator>Telligent Community 12</generator><item><title>RE: Refresh Variable Not Refreshing</title><link>https://community.appian.com/thread/152168?ContentTypeID=1</link><pubDate>Fri, 24 Oct 2025 13:13:05 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:55cf7ecd-76cf-4d04-9b89-4f5cc9a6ccb8</guid><dc:creator>Mike Schmitt</dc:creator><description>&lt;p&gt;I&amp;#39;m pretty unclear what your chain of events is here, but you&amp;#39;ll still need to make sure that all DB writes (in the record action process itself as well as any launched Start Process events from that form) are chained through before returning to the original interface.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Refresh Variable Not Refreshing</title><link>https://community.appian.com/thread/152159?ContentTypeID=1</link><pubDate>Thu, 23 Oct 2025 20:27:14 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:9333c534-8cbf-4898-804c-0db2101b23c8</guid><dc:creator>Carey Kitsunari</dc:creator><description>&lt;p&gt;Technically, no. The record action simply calls a UI that allows them to perform other actions. There is a button on there that calls a start process smart service to kick off document regeneration. However, the record action IS activity chained through.&lt;/p&gt;
&lt;p&gt;&lt;img style="max-height:240px;max-width:320px;" src="/resized-image/__size/640x480/__key/communityserver-discussions-components-files/11/pastedimage1761251232792v2.png" alt=" " /&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Refresh Variable Not Refreshing</title><link>https://community.appian.com/thread/152127?ContentTypeID=1</link><pubDate>Tue, 21 Oct 2025 20:12:19 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:e16f27dd-2095-46fa-ba02-ad4cdd940bc1</guid><dc:creator>Mike Schmitt</dc:creator><description>[quote userid="116303" url="~/discussions/f/general/39861/refresh-variable-not-refreshing/152125"]we need to re-query the table to refresh the variables that we use to determine which rows need regeneration, but as seen above, that is not happening[/quote]
&lt;p&gt;Is the record action process activity-chained all the way through the final DB change(s) that would be expected to get picked up in the refreshed query?&amp;nbsp; If not, then this setup won&amp;#39;t work (as the refresh will take place immediately after chaining breaks, and most likely happen before the final DB writes).&amp;nbsp; If you could post an overview screenshot of your process flow, that might help.&amp;nbsp; Certain screenshot tools (i like the freeware &amp;quot;greenshot&amp;quot;) allow piecemeal redaction of individual screenshot elements if they contain sensitive info, fwiw.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Refresh Variable Not Refreshing</title><link>https://community.appian.com/thread/152126?ContentTypeID=1</link><pubDate>Tue, 21 Oct 2025 18:45:16 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:f11f6594-685a-4387-8bb2-ca4d250513a1</guid><dc:creator>Carey Kitsunari</dc:creator><description>&lt;p&gt;The record action is opened in a dialog.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Refresh Variable Not Refreshing</title><link>https://community.appian.com/thread/152125?ContentTypeID=1</link><pubDate>Tue, 21 Oct 2025 18:44:35 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:f0e7bedf-f759-43d5-aadb-667b17a0ef01</guid><dc:creator>Carey Kitsunari</dc:creator><description>&lt;p&gt;So the process is essentially, Documents are generated and sent to clients to sign &amp;gt; Clients sign when they have time &amp;gt; we upload the signed documents and proceed with more processes.&lt;br /&gt;&lt;br /&gt;To prevent documents from sitting in storage for too long, we have an expiration date for each document. However, due to a poor design we need to work around at the moment, we have to query a table to see if the documents were deleted during a cleanup cron job.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;So, we have a UI that is calling a record action to regenerate the document. Once the document is regenerated, we can proceed. This is task based, so the user is shown a list of tasks, some of which will have expired docs.&amp;nbsp;&lt;br /&gt;&lt;br /&gt;The issue here is, when they call the record action to regenerate the documents, we need to re-query the table to refresh the variables that we use to determine which rows need regeneration, but as seen above, that is not happening. I don&amp;#39;t really understand why the local!refresh variable is refreshing, but not the cascading variables. We are not expecting the passed-in RI value to change, just the local variables.&lt;br /&gt;&lt;br /&gt;Is there any further details I can provide to assist in a recommendation?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Refresh Variable Not Refreshing</title><link>https://community.appian.com/thread/152122?ContentTypeID=1</link><pubDate>Tue, 21 Oct 2025 16:51:05 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:c8367010-a523-44ea-9ed2-b3e2606a86b6</guid><dc:creator>Shubham Aware</dc:creator><description>&lt;p&gt;When the record action completes, are you staying on the same interface, or does it navigate away/close a dialog?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Refresh Variable Not Refreshing</title><link>https://community.appian.com/thread/152117?ContentTypeID=1</link><pubDate>Tue, 21 Oct 2025 15:37:25 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:df33380b-b9b4-4de4-9333-c1c94d68d321</guid><dc:creator>Mike Schmitt</dc:creator><description>&lt;p&gt;I sometimes use a technique similar to this, but instead of calling &amp;quot;rand()&amp;quot;, I would recommend you call &amp;quot;now()&amp;quot; so that you can view the updated timestamp pertaining to the last time the refresh variable updated.&lt;/p&gt;
&lt;p&gt;Further, be careful as to whether you&amp;#39;re assuming any passed-in RI values might refresh due to the refresh variable (they won&amp;#39;t, at least not inherently), as well as the refresh behavior of any expression rules you call (when they contain their own local variables).&amp;nbsp; Aside from those suggestions, I don&amp;#39;t know whether we see a complete enough picture of either your setup here, or the resulting behavior, to make many guesses as to the cause of what you&amp;#39;re experiencing.&amp;nbsp; I do stand behind @Shubham&amp;#39;s earlier suggestion to cascade refreshes - it looks like you&amp;#39;ve already incorporated that into the example code you posted.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Refresh Variable Not Refreshing</title><link>https://community.appian.com/thread/152116?ContentTypeID=1</link><pubDate>Tue, 21 Oct 2025 15:09:42 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:5087fee6-30cb-46e5-9232-6e30335a24cf</guid><dc:creator>Carey Kitsunari</dc:creator><description>&lt;p&gt;I&amp;#39;m not sure I understand the question. I have record actions being called in a gridField, which is properly updating the local!refresh variable. But the cascading variables are not updating.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Refresh Variable Not Refreshing</title><link>https://community.appian.com/thread/152115?ContentTypeID=1</link><pubDate>Tue, 21 Oct 2025 15:06:45 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:53b0e771-4b4d-4874-9063-e81646a72a58</guid><dc:creator>sumeetk4983</dc:creator><description>&lt;p&gt;This might sound odd, but do you have a record action for that page (the entire interface)? I can refresh the local&lt;span&gt;&amp;nbsp;&lt;/span&gt;&lt;span class="font-semibold"&gt;refresh&lt;/span&gt;&lt;span&gt;&amp;nbsp;&lt;/span&gt;variable using your logic.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Refresh Variable Not Refreshing</title><link>https://community.appian.com/thread/152114?ContentTypeID=1</link><pubDate>Tue, 21 Oct 2025 13:39:49 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:71d8525d-2ef2-48a7-b2ef-0f1bd4db627c</guid><dc:creator>Carey Kitsunari</dc:creator><description>&lt;p&gt;This doesn&amp;#39;t work. I attempted the fix you suggested. I also attempted the following fix to see if I could simply get it to work.&lt;pre class="ui-code" data-mode="text"&gt;local!refresh: a!refreshVariable(
  value: rand(),
  refreshAfter: &amp;quot;RECORD_ACTION&amp;quot;
),
local!selected_tasks: a!refreshVariable(
  value: a!queryRecordType(...).data,
  refreshOnVarChange: local!refresh
),
local!expired_tasks: a!refreshVariable(
  value: a!forEach(...),
  refreshOnVarChange: local!refresh
)&lt;/pre&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Refresh Variable Not Refreshing</title><link>https://community.appian.com/thread/152106?ContentTypeID=1</link><pubDate>Tue, 21 Oct 2025 01:52:33 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:74775585-582f-4d95-8c50-1fad56f09eba</guid><dc:creator>Shubham Aware</dc:creator><description>&lt;p&gt;Doesn&amp;rsquo;t inherently cascade refreshes each dependent variable must declare what triggers it. So link refreshOnVarChange at each layer, ensuring refresh propagation across local!refresh -&amp;gt; local!selected_tasks -&amp;gt; local!expired_tasks.&lt;br /&gt;&lt;br /&gt;&lt;pre class="ui-code" data-mode="text"&gt;local!refresh: a!refreshVariable(
  value: rand(),
  refreshAfter: &amp;quot;RECORD_ACTION&amp;quot;
),
local!selected_tasks: a!refreshVariable(
  value: a!queryRecordType(...).data,
  refreshOnVarChange: local!refresh
),
local!expired_tasks: a!refreshVariable(
  value: a!forEach(...),
  refreshOnVarChange: local!selected_tasks
)&lt;/pre&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>