<?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>I want to keep the old value of rule input in the local variable even if the data has been changed in the rule input later on</title><link>https://community.appian.com/discussions/f/general/34649/i-want-to-keep-the-old-value-of-rule-input-in-the-local-variable-even-if-the-data-has-been-changed-in-the-rule-input-later-on</link><description>Step1: Getting data using rule input. Ex: rule input is of integer type and the current value is 1000. 
 Step 2: create local variable and fill with the rule input value that is 1000 
 Step 3: on button click, rule input value gets changed to 2000. 
</description><dc:language>en-US</dc:language><generator>Telligent Community 12</generator><item><title>RE: I want to keep the old value of rule input in the local variable even if the data has been changed in the rule input later on</title><link>https://community.appian.com/thread/133474?ContentTypeID=1</link><pubDate>Mon, 15 Apr 2024 12:55:04 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:960e0d2f-80f3-4ca0-9b31-0c1aaf497942</guid><dc:creator>palasha1583</dc:creator><description>&lt;p&gt;Thank you for the response. It&amp;#39;s working!!&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: I want to keep the old value of rule input in the local variable even if the data has been changed in the rule input later on</title><link>https://community.appian.com/thread/133333?ContentTypeID=1</link><pubDate>Fri, 12 Apr 2024 20:06:06 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:f40adff4-1ced-4778-a2c0-4d99d3e64d83</guid><dc:creator>Mike Schmitt</dc:creator><description>[quote userid="29732" url="~/discussions/f/general/34649/i-want-to-keep-the-old-value-of-rule-input-in-the-local-variable-even-if-the-data-has-been-changed-in-the-rule-input-later-on/133253"]a!localVariable(),&amp;nbsp; inside load()[/quote]
&lt;p&gt;No!&amp;nbsp; Nobody should be using &lt;em&gt;&lt;strong&gt;load()&lt;/strong&gt;&lt;/em&gt; under ANY CIRCUMSTANCES now, it is DEPRECATED.&amp;nbsp; (Additionally it is BAD PRACTICE to still use load() or with(), because among other things, variables defined using these old functions will not appear in the side-bar variable value monitoring pane, which is critical to proper development and testing.)&lt;/p&gt;
&lt;p&gt;Also, don&amp;#39;t put an &amp;quot;a!localVariables()&amp;quot; call inside a &lt;em&gt;load()&lt;/em&gt; call, that is nonsensical and won&amp;#39;t do anything.&lt;/p&gt;
&lt;p&gt;Instead you ONLY need to use a!localVariables(), with the a!refreshVariable() used in the variable&amp;#39;s definition, with the &amp;quot;refresh on referenced var change&amp;quot; parameter passed in as FALSE (it defaults to TRUE for all a!localVariables() variables unless specified as FALSE in this manner). The example code posted down-thread already by  is a correct demonstration of this.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: I want to keep the old value of rule input in the local variable even if the data has been changed in the rule input later on</title><link>https://community.appian.com/thread/133269?ContentTypeID=1</link><pubDate>Fri, 12 Apr 2024 10:58:34 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:3dd09dff-427b-4210-a2ca-6188a8290914</guid><dc:creator>Shubham Aware</dc:creator><description>&lt;p&gt;Try to Simulate below as per your code&lt;br /&gt;I am passing rule Input(ri!integerInput) value as 1000. Change ri! as per your need.&lt;br /&gt;&lt;pre class="ui-code" data-mode="text"&gt;a!localVariables(
  local!integerValue: a!refreshVariable(
    value: ri!integerInput,
    refreshOnReferencedVarChange: false
  ),
  {
    a!buttonArrayLayout(
      buttons: {
        a!buttonWidget(
          label: &amp;quot;Button&amp;quot;,
          style: &amp;quot;OUTLINE&amp;quot;,
          value: true,
          saveInto: a!save(ri!integerInput, 2000)
        )
      },
      align: &amp;quot;START&amp;quot;,
      marginBelow: &amp;quot;NONE&amp;quot;
    )
  }
)&lt;/pre&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: I want to keep the old value of rule input in the local variable even if the data has been changed in the rule input later on</title><link>https://community.appian.com/thread/133255?ContentTypeID=1</link><pubDate>Fri, 12 Apr 2024 10:08:16 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:349c76d6-e45e-4919-ac13-1abbf65bd931</guid><dc:creator>venkatrea696188</dc:creator><description>&lt;p&gt;Need more context ,Rule input gonna change multiple times??,If yes Do you want to update local variable&amp;nbsp; value ??&lt;/p&gt;
&lt;p&gt;&lt;a href="https://docs.appian.com/suite/help/24.1/Updating_Expressions_to_Use_a_localVariables.html#variable-that-should-not-update-when-its-dependencies-change"&gt;Go through this link&lt;/a&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: I want to keep the old value of rule input in the local variable even if the data has been changed in the rule input later on</title><link>https://community.appian.com/thread/133253?ContentTypeID=1</link><pubDate>Fri, 12 Apr 2024 09:57:48 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:de666b8b-80ae-4623-b31d-1b191bc15180</guid><dc:creator>karthikkanjerla</dc:creator><description>&lt;p&gt;&amp;nbsp;&lt;a href="/members/palasha1583"&gt;palasha1583&lt;/a&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Use the a!localVariable(),&amp;nbsp; inside load() , example as below, once you declare the variable under load it wont change.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Please use below code as example for reference.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;load(

local!varA:ri!InputValue,


a!localVariables(


{

a!textField(
label:&amp;quot;Test&amp;quot;&amp;amp; local!varA,
value:ri!InputValue,
saveInto: ri!InputValue

),



}



)
)&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Click on test interface and provide the input value and , and try updating the value in text field, the value of the local!varA wont change&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>