<?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>dropdown</title><link>https://community.appian.com/discussions/f/user-interface/24374/dropdown</link><description>Hi, 
 I have a dropdown with 2 values. 
 I have a scenario like once after selecting &amp;quot;Cancelled&amp;quot; I have to show a textfield to enter comments and save the details. This I am able to achieve. 
 But, at the same time I have to remove &amp;quot;Cancelled&amp;quot; option</description><dc:language>en-US</dc:language><generator>Telligent Community 12</generator><item><title>RE: dropdown</title><link>https://community.appian.com/thread/94074?ContentTypeID=1</link><pubDate>Sun, 24 Apr 2022 22:52:08 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:aee4f8d4-8377-4038-ae94-ed7aa8c8b07f</guid><dc:creator>Naresh</dc:creator><description>&lt;p&gt;There are couple of issues in your code. First you are appending null values to your dropdown list. Second,&amp;nbsp; your save logic is conflicting with you local variable dropdown logic list. Try this code it will work for your case&lt;pre class="ui-code" data-mode="xml"&gt;a!localVariables(
  local!reviewOptionLables: if(
    ri!opinionData.RequestStaus = &amp;quot;PA&amp;quot;,
    {&amp;quot;Additional Info Required&amp;quot;, &amp;quot;Cancelled&amp;quot;},
    {&amp;quot;Additional Info Required&amp;quot;}
  ),
  local!reviewOptionValues: if(
    ri!opinionData.RequestStaus = &amp;quot;PA&amp;quot;,
    {&amp;quot;AIR&amp;quot;, &amp;quot;CED&amp;quot;},
    &amp;quot;AIR&amp;quot;
  ),
  local!selectedReviewOption,
  
  
  
  
  
  a!formLayout(
    contents: {
      a!dropdownField(
        label: &amp;quot;Review Options&amp;quot;,
        placeholder: &amp;quot;-- Review Options --&amp;quot;,
        choiceLabels: local!reviewOptionLables,
        choiceValues: local!reviewOptionValues,
        value: local!selectedReviewOption,
        saveInto: {
          local!selectedReviewOption,
          ri!opinionReviewOption, /*Assuming this is where you are saving final selection */
          /*Resetting your reason every time option is changed*/
          a!save(
            ri!reason,
            null
          )
        }
      ),
      a!textField(
        showWhen: ri!opinionReviewOption = &amp;quot;Cancelled&amp;quot;,
        label: &amp;quot;Reason&amp;quot;,
        value: ri!reason,
        saveInto: {
          ri!reason,
      /* Not sure where you have this save logic in your code - Take this logic and place in your code whre appropriate*/
          a!save(
            local!selectedReviewOption,
            null
          ),
          a!save(
            ri!opinionData.RequestStaus,
            if(
              ri!opinionReviewOption = &amp;quot;AIR&amp;quot;,
              &amp;quot;PA&amp;quot;,
              if(
                ri!opinionReviewOption = &amp;quot;CED&amp;quot;,
                &amp;quot;CA&amp;quot;,
                &amp;quot;&amp;quot;
              )
            )
          )
        }
      )
    }
  )
)&lt;/pre&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: dropdown</title><link>https://community.appian.com/thread/94072?ContentTypeID=1</link><pubDate>Sun, 24 Apr 2022 22:31:35 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:0f38dd61-1e26-48ec-a715-c990059d2f89</guid><dc:creator>Naresh</dc:creator><description>&lt;p&gt;you are saying you are submitting the form,&amp;nbsp;If you&amp;nbsp;you submit the form how do you getting this form again, because once submit the form you will navigate back to your dashboard(Or where ever you initially came from).&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Please try this code if you are writing something on submit button.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="xml"&gt;a!formLayout(
    contents: {
      a!dropdownField(
        label: &amp;quot;Review Options&amp;quot;,
        placeholder: &amp;quot;-- Review Options --&amp;quot;,
        choiceLabels: local!reviewOptionLables,
        choiceValues: local!reviewOptionValues,
        value: local!selectedReviewOption,
        saveInto: {
          local!selectedReviewOption,
          ri!opinionReviewOption, /*Assuming this is where you are saving final selection */
          /*Resetting your reason every time option is changed*/
          a!save(
            ri!reason,
            null
          )
        }
      ),
      a!textField(
        showWhen: ri!opinionReviewOption = &amp;quot;Cancelled&amp;quot;,
        label: &amp;quot;Reason&amp;quot;,
        value: ri!reason,
        saveInto: {
          ri!reason
        }
      )
    },
    buttons: {
      a!buttonLayout(
        primaryButtons: {
          a!buttonWidget(
            label: &amp;quot;Submit&amp;quot;,
            style: &amp;quot;PRIMARY&amp;quot;,
            saveInto: {
              /*Assuming you are writing data to DB directly here*/
              a!save(
                local!selectedReviewOption, 
                null
              )
            }
          )
        }
      )
    }
  )&lt;/pre&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: dropdown</title><link>https://community.appian.com/thread/94071?ContentTypeID=1</link><pubDate>Sun, 24 Apr 2022 22:28:39 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:b188accc-652a-45a5-97a5-b64e1f4e51de</guid><dc:creator>Hari Kishore Reddy</dc:creator><description>&lt;p&gt;some more additional details:&lt;/p&gt;
&lt;p&gt;More details. Local variables used to set the dropdown labels and values.&lt;/p&gt;
&lt;p&gt;&lt;img src="/resized-image/__size/320x240/__key/communityserver-discussions-components-files/13/pastedimage1650839190081v1.png" alt=" " /&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src="/resized-image/__size/320x240/__key/communityserver-discussions-components-files/13/pastedimage1650839271915v2.png" alt=" " /&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src="/resized-image/__size/320x240/__key/communityserver-discussions-components-files/13/pastedimage1650839305271v3.png" alt=" " /&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: dropdown</title><link>https://community.appian.com/thread/94070?ContentTypeID=1</link><pubDate>Sun, 24 Apr 2022 22:19:46 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:f9d012cb-ffcf-48dd-a1f2-178765353ac2</guid><dc:creator>Hari Kishore Reddy</dc:creator><description>&lt;p&gt;After selecting &amp;quot;Cancelled&amp;quot;, I am showing a a!textField, where user is entering Cancel reason. Now, after submitting the form, I should not show the &amp;quot;Cancelled&amp;quot; option anymore.&lt;/p&gt;
&lt;p&gt;But, with my current code, it was throwing an error after submitting the form.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: dropdown</title><link>https://community.appian.com/thread/94069?ContentTypeID=1</link><pubDate>Sun, 24 Apr 2022 22:15:01 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:c1a909e0-e1eb-447b-9e49-50e077467c19</guid><dc:creator>Naresh</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;Your question is not clear, when do you want to remove Cancelled option from selected drop down list after entering and saving comments?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>