<?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>How do I reset a dropdown value on radio change?</title><link>https://community.appian.com/discussions/f/user-interface/27885/how-do-i-reset-a-dropdown-value-on-radio-change</link><description>I have the following: 
 When the country value changes, the display value for State/Province changes, but the ri!selectedSate value does not reset to null. How can I get ri!selectedState to reset it&amp;#39;s value?</description><dc:language>en-US</dc:language><generator>Telligent Community 12</generator><item><title>RE: How do I reset a dropdown value on radio change?</title><link>https://community.appian.com/thread/108630?ContentTypeID=1</link><pubDate>Tue, 28 Feb 2023 18:00:32 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:4349beb1-e754-44ff-9098-dba9f6a12c10</guid><dc:creator>Abhay Dalsaniya</dc:creator><description>&lt;p&gt;Good to know, thanks &lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How do I reset a dropdown value on radio change?</title><link>https://community.appian.com/thread/108618?ContentTypeID=1</link><pubDate>Tue, 28 Feb 2023 13:56:24 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:fc67adb1-39e4-443e-9e38-e316e917f66e</guid><dc:creator>Stefan Helzle</dc:creator><description>&lt;p&gt;Correct. By default, any variable will refresh when a referenced variable changes. Even when NOT wrapped into a&amp;nbsp;a!refreshVariable().&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How do I reset a dropdown value on radio change?</title><link>https://community.appian.com/thread/108617?ContentTypeID=1</link><pubDate>Tue, 28 Feb 2023 13:45:40 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:0edf98fd-8625-428a-866a-771f95a19707</guid><dc:creator>petel0001</dc:creator><description>&lt;p&gt;I don&amp;#39;t need to worry about&amp;nbsp;a!refreshVariable().&lt;/p&gt;
&lt;p&gt;The SaveInto mentioned previously solves the issue for me.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How do I reset a dropdown value on radio change?</title><link>https://community.appian.com/thread/108578?ContentTypeID=1</link><pubDate>Mon, 27 Feb 2023 23:33:24 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:e026d48a-2732-48ba-b3e8-0e5879cfd238</guid><dc:creator>Abhay Dalsaniya</dc:creator><description>&lt;p&gt;&lt;span style="font-family:verdana, geneva;font-size:inherit;"&gt;&lt;em class="EmphasisText---richtext_emphasis"&gt;To see what a!refreshVariable() is doing, just remove it and refer the direct value, and you will understand&amp;nbsp;how it works.&lt;/em&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-family:verdana, geneva;font-size:inherit;"&gt;&lt;em class="EmphasisText---richtext_emphasis"&gt;To shed some more light ...&lt;/em&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-family:verdana, geneva;font-size:inherit;"&gt;&lt;em class="EmphasisText---richtext_emphasis"&gt;refreshOnReferencedVarChange&amp;nbsp;- parameter doing the trick here. It&amp;#39;s set as true by default and hence the local variables are getting refreshed on ReferencedVarChange.&lt;/em&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-family:verdana, geneva;font-size:inherit;"&gt;&lt;em class="EmphasisText---richtext_emphasis"&gt;refreshOnReferencedVarChange&lt;/em&gt; (Boolean): When true, the value of this local variable will be refreshed each time the value of any variable it references within the value parameter is updated. To refresh the local variable when another variable that is not used within value changes, use refreshOnVarChange. &lt;span style="background-color:#ffff99;"&gt;Default: true.&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How do I reset a dropdown value on radio change?</title><link>https://community.appian.com/thread/108561?ContentTypeID=1</link><pubDate>Mon, 27 Feb 2023 13:33:35 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:90accacc-8fc7-48f5-af96-235ca98d0a0f</guid><dc:creator>petel0001</dc:creator><description>&lt;p&gt;The refreshVariable doesn&amp;#39;t seem to do anything in this instance.&lt;/p&gt;
&lt;p&gt;However, the saveInto for the radioButtonField works as expected.&lt;br /&gt;&lt;br /&gt;&lt;/p&gt;
&lt;p&gt;Thanks,&lt;/p&gt;
&lt;p&gt;pete&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How do I reset a dropdown value on radio change?</title><link>https://community.appian.com/thread/108499?ContentTypeID=1</link><pubDate>Fri, 24 Feb 2023 21:51:08 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:35bef57e-c6e1-42f9-9282-64fbe812ec86</guid><dc:creator>Abhay Dalsaniya</dc:creator><description>&lt;p&gt;If you want to reset&amp;nbsp;&lt;span&gt;ri!selectedSate to null on change of radio selection, here is the code for that.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="java"&gt;a!radioButtonField(
label: &amp;quot;Country&amp;quot;,
labelPosition: &amp;quot;ABOVE&amp;quot;,
choiceLabels: local!countries,
choiceValues: local!countries,
value: { local!selectedCountry },
saveInto: { local!selectedCountry, a!save(ri!selectedSate, null) },
choiceLayout: &amp;quot;COMPACT&amp;quot;,
choiceStyle: &amp;quot;STANDARD&amp;quot;,
validations: {})&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Also you may use following to refresh local variable when the referenced variable changes.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="java"&gt;a!localVariables(
  local!countries: rule!PT_GetAvailableCountries(),
  local!selectedCountry: a!refreshVariable(value: local!countries),
  local!states: a!refreshVariable(value: rule!PT_GetStateByCountry(local!selectedCountry)),
  a!formLayout(
    label: &amp;quot;Create Customer&amp;quot;,
    contents: {
      a!columnsLayout(&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>