<?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>refreshVariables</title><link>https://community.appian.com/discussions/f/new-to-appian/22107/refreshvariables</link><description>So I&amp;#39;m building an interface and part of it the user can change address and add credits to his account, but when i add credits I need to update the browser in order to display the new balance value, I&amp;#39;ve been told I need to use refreshVariable but doesnt</description><dc:language>en-US</dc:language><generator>Telligent Community 12</generator><item><title>RE: refreshVariables</title><link>https://community.appian.com/thread/86624?ContentTypeID=1</link><pubDate>Mon, 04 Oct 2021 14:36:51 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:1ab0b102-6f98-4444-85f7-ea6ca8521190</guid><dc:creator>pedrob0002</dc:creator><description>&lt;p&gt;Just updated it and it works fine, thank you so much&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: refreshVariables</title><link>https://community.appian.com/thread/86623?ContentTypeID=1</link><pubDate>Mon, 04 Oct 2021 14:27:29 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:036dfebe-404c-45ef-bc0d-1bd623997e9f</guid><dc:creator>Danny Verb</dc:creator><description>&lt;p&gt;You&amp;#39;re running into a common local variable problem:&amp;nbsp;&lt;a href="https://docs.appian.com/suite/help/20.4/Local_Variables.html#using-local-variables-in-the-definition-of-refreshing-variables"&gt;https://docs.appian.com/suite/help/20.4/Local_Variables.html#using-local-variables-in-the-definition-of-refreshing-variables&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Basically, your expression rule is querying the data once and then during each refresh on your interface,&amp;nbsp;&lt;br /&gt;Appian isn&amp;#39;t requerying the data it&amp;#39;s just getting the cached value. If you wrap local!results in a!refreshVariable() and set refreshAlways to true, then the value will refresh in your interface.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: refreshVariables</title><link>https://community.appian.com/thread/86622?ContentTypeID=1</link><pubDate>Mon, 04 Oct 2021 14:24:40 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:769f7d1f-42b0-423f-9412-cd093afa1392</guid><dc:creator>pedrob0002</dc:creator><description>&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;a!localVariables(
  local!results:
a!queryEntity(
  entity: cons!AS_DataStore_Account_Pointer,
  query: a!query(
    logicalExpression: a!queryLogicalExpression(
      operator: &amp;quot;AND&amp;quot;,
      filters: {
        a!queryFilter(
          field: &amp;quot;name&amp;quot;,
          operator: &amp;quot;=&amp;quot;,
          value: ri!user
        )
      },
      ignoreFiltersWithEmptyValues: true
    ),
    pagingInfo: a!pagingInfo(
      startIndex: 1,
      batchSize: 50
    )
  ),
  fetchTotalCount: false
).data,
cast(
  typeof(&amp;#39;type!{urn:appian:as}AS_User_Account&amp;#39;()),local!results
)
)&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;the values update, but only after I refresh the browser&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: refreshVariables</title><link>https://community.appian.com/thread/86616?ContentTypeID=1</link><pubDate>Mon, 04 Oct 2021 13:42:40 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:82108617-e0dc-4639-95ca-db40d7f62a67</guid><dc:creator>Danny Verb</dc:creator><description>&lt;p&gt;In the interface designer, you should be able to see the value of variables after each page evaluation. Also, can you share the code inside AS_Get_Account ?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: refreshVariables</title><link>https://community.appian.com/thread/86614?ContentTypeID=1</link><pubDate>Mon, 04 Oct 2021 13:29:03 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:b369aa1d-e683-46e7-af7f-22062c15b8d1</guid><dc:creator>pedrob0002</dc:creator><description>&lt;p&gt;local!user: a!refreshVariable(value: rule!AS_Get_Account(loggedInUser()), refreshOnVarChange: local!addedcredit),&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;still doesn&amp;#39;t update&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: refreshVariables</title><link>https://community.appian.com/thread/86613?ContentTypeID=1</link><pubDate>Mon, 04 Oct 2021 13:06:12 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:65fe970a-4eb8-4e6c-9977-463addaa9226</guid><dc:creator>Danny Verb</dc:creator><description>&lt;p&gt;It looks like you actually want to wrap local!user in a refreshVariable. Just using a!localVariables does not make a variable a refreshVariable. Similar to the example above, wrap local!user in a!refreshVariable and have local!user refresh on the change local!addedCredit.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: refreshVariables</title><link>https://community.appian.com/thread/86601?ContentTypeID=1</link><pubDate>Mon, 04 Oct 2021 08:22:13 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:6391cfd2-a33f-449e-945b-152082ad058a</guid><dc:creator>pedrob0002</dc:creator><description>&lt;p&gt;Should I have used a process model instead of a a!writetodatabase?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: refreshVariables</title><link>https://community.appian.com/thread/86600?ContentTypeID=1</link><pubDate>Mon, 04 Oct 2021 08:21:37 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:ae7a868a-2f9d-4219-a2c0-76c3cc1f8545</guid><dc:creator>pedrob0002</dc:creator><description>&lt;p&gt;It doesn&amp;#39;t work&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: refreshVariables</title><link>https://community.appian.com/thread/86595?ContentTypeID=1</link><pubDate>Mon, 04 Oct 2021 04:27:45 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:fca78416-011e-4c9b-8dac-a0aca6a96521</guid><dc:creator>Ravi Roshan</dc:creator><description>&lt;p&gt;&amp;nbsp;&lt;pre class="ui-code" data-mode="text"&gt;a!localVariables(
  local!addedCredit,
  local!balanceValue: a!refreshVariable(
    value: &amp;quot;&amp;quot; /*Put your balance calculation here*/,
    refreshOnVarChange: local!addedCredit
  ),
  /*
  ...
  ...
  ...
  .
   Your other code..
  */
  
)&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;I do not see that you have used refresh variable anywhere in your code. You can do it as attached code.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>