<?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 have a dropdown field where we need to default values based on couple of conditions</title><link>https://community.appian.com/discussions/f/user-interface/38889/i-have-a-dropdown-field-where-we-need-to-default-values-based-on-couple-of-conditions</link><description>I used if() to check the condition in Value() parameter of dropdown which is working fine from front end, but the value is not saved when i use the same logic in SaveInto() parameter of dropdown. 
 Logic used in Value() parameter: 
 if( and( ri!eventType</description><dc:language>en-US</dc:language><generator>Telligent Community 12</generator><item><title>RE: I have a dropdown field where we need to default values based on couple of conditions</title><link>https://community.appian.com/thread/147098?ContentTypeID=1</link><pubDate>Thu, 10 Apr 2025 22:01:24 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:3d29535d-457d-4c3a-82b8-d2ca382041e9</guid><dc:creator>poojithak2926</dc:creator><description>&lt;p&gt;Hi Guys, I tried to set the default values on submitting the screen and the value is now stored. Thanks to all.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: I have a dropdown field where we need to default values based on couple of conditions</title><link>https://community.appian.com/thread/147097?ContentTypeID=1</link><pubDate>Thu, 10 Apr 2025 21:57:27 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:09ab82fe-86e7-4c11-87ed-0e5bc0ba3ada</guid><dc:creator>osanchea</dc:creator><description>&lt;p&gt;Hi. You can try this:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;    value: if(
        and(
          ri!eventType = cons!INS_INT_EVENT_TYPE_ID_ANZ_ARREARS,
          ri!policyNo = cons!INS_TXT_MULTIPLE
        ),
        &amp;quot;Contact Centre Outbound&amp;quot;,
        if(
          and(
            ri!eventType = cons!INS_INT_EVENT_TYPE_ID_ANZ_ARREARS,
            ri!policyNo = cons!INS_TXT_SINGLE
          ),
          &amp;quot;Contact Centre Inbound&amp;quot;,
          ri!application.incomingSource
        )
      ),
    saveInto: { ri!application.incomingSource },
    searchDisplay: &amp;quot;AUTO&amp;quot;,
    disabled: and(
        ri!eventType = cons!INS_INT_EVENT_TYPE_ID_ANZ_ARREARS,
        or(
          ri!policyNo = cons!INS_TXT_SINGLE,
          ri!policyNo = cons!INS_TXT_MULTIPLE
        ),
    )&lt;/pre&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: I have a dropdown field where we need to default values based on couple of conditions</title><link>https://community.appian.com/thread/147067?ContentTypeID=1</link><pubDate>Thu, 10 Apr 2025 05:39:42 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:d6d86fc4-d63e-49d6-9f0b-e9303b666e16</guid><dc:creator>Stefan Helzle</dc:creator><description>&lt;p&gt;The saveInto is only evaluated when the user interacts with that field. That&amp;#39;s a challenge if you make it readonly.&lt;/p&gt;
&lt;p&gt;The trick to default values, is to populate the values in the data. The fields cannot do that for you.&lt;/p&gt;
&lt;p&gt;Check the Appian documentation&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/13/pastedimage1744263573117v1.png" alt=" " /&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: I have a dropdown field where we need to default values based on couple of conditions</title><link>https://community.appian.com/thread/147064?ContentTypeID=1</link><pubDate>Thu, 10 Apr 2025 05:16:41 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:2a1d1537-5133-41bb-b9bb-f0dc6818fae2</guid><dc:creator>poojithak2926</dc:creator><description>&lt;p&gt;Hello, thanks for the response. The field is set to read-only in condition 1,condition 2 and editable in the rest of the scenarios which is why i am trying to set a default value conditionally. I tried the code but still the value is not being saved.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: I have a dropdown field where we need to default values based on couple of conditions</title><link>https://community.appian.com/thread/147063?ContentTypeID=1</link><pubDate>Thu, 10 Apr 2025 05:07:26 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:e506f83c-9c13-4d64-8369-a535765f974c</guid><dc:creator>varung120549</dc:creator><description>&lt;p&gt;Hi&amp;nbsp;&lt;a href="/members/poojithak2926"&gt;poojithak2926&lt;/a&gt;&amp;nbsp;,&lt;br /&gt;&lt;br /&gt;You&amp;#39;re dynamically setting a value based on conditions, &lt;strong data-start="349" data-end="405"&gt;but the &lt;/strong&gt;saveInto&lt;strong data-start="349" data-end="405"&gt; isn&amp;#39;t saving the user&amp;#39;s selection&lt;/strong&gt;, it&amp;rsquo;s conditionally setting a value regardless of what the user picks.&lt;br /&gt;&lt;br /&gt;In dropdowns, &lt;strong data-start="552" data-end="563"&gt;&lt;code data-start="554" data-end="561"&gt;value&lt;/code&gt;&lt;/strong&gt; is what&amp;#39;s currently selected (displayed to the user), and &lt;strong&gt;saveInto&lt;/strong&gt; should save &lt;strong data-start="649" data-end="674"&gt;what the user selects&lt;/strong&gt;.&lt;br /&gt;&lt;br /&gt;If you want to conditionally &lt;strong data-start="706" data-end="718"&gt;override&lt;/strong&gt; what the user selects and force a particular value into &lt;strong&gt;ri!application.incomingSource&amp;nbsp;&lt;/strong&gt;based on other rule inputs, &lt;strong data-start="835" data-end="909"&gt;you need to wrap the logic inside an &lt;/strong&gt;a!save&lt;strong data-start="835" data-end="909"&gt;&amp;nbsp;that uses &lt;/strong&gt;save!value.&lt;/p&gt;
&lt;p&gt;You can use &lt;strong&gt;save!value&lt;/strong&gt;&amp;nbsp;as&lt;strong&gt;:&lt;br /&gt;&lt;br /&gt;&lt;pre class="ui-code" data-mode="text"&gt;{
  a!save(
    ri!application.incomingSource,
    if(
      and(
        ri!eventType = cons!INS_INT_EVENT_TYPE_ID_ANZ_ARREARS,
        ri!policyNo = cons!INS_TXT_MULTIPLE
      ),
      &amp;quot;Contact Centre Outbound&amp;quot;,
      if(
        and(
          ri!eventType = cons!INS_INT_EVENT_TYPE_ID_ANZ_ARREARS,
          ri!policyNo = cons!INS_TXT_SINGLE
        ),
        &amp;quot;Contact Centre Inbound&amp;quot;,
        save!value
      )
    )
  )
}&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;&lt;/strong&gt;Try the above code and let me know!!!&lt;br /&gt;&lt;br /&gt;Hope this helps you!!!&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>