<?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 null value issue</title><link>https://community.appian.com/discussions/f/user-interface/13177/dropdown-null-value-issue</link><description>Hi , 
 
 I have an issue with dropdown. I want to display current year by default in my year dropdown. 
 For that i have appended year with the year dataset but its giving me error. 
 /*placeholderLabel: &amp;quot;--Select a Year-- &amp;quot;,*/ - In this by default current</description><dc:language>en-US</dc:language><generator>Telligent Community 12</generator><item><title>RE: Dropdown null value issue</title><link>https://community.appian.com/thread/59518?ContentTypeID=1</link><pubDate>Fri, 24 Aug 2018 08:05:01 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:0d361385-b317-47a4-9f3d-98339883b8fb</guid><dc:creator>saivineeths</dc:creator><description>Please try below code,&lt;br /&gt;
&lt;br /&gt;
load(&lt;br /&gt;
  local!data: {&lt;br /&gt;
    2016,&lt;br /&gt;
    2017,&lt;br /&gt;
    year(&lt;br /&gt;
      now()&lt;br /&gt;
    )&lt;br /&gt;
  },&lt;br /&gt;
  local!selectedYear,&lt;br /&gt;
  a!formLayout(&lt;br /&gt;
    contents: {&lt;br /&gt;
      a!dropdownField(&lt;br /&gt;
        label: &amp;quot;Year&amp;quot;,&lt;br /&gt;
        labelPosition: &amp;quot;ABOVE&amp;quot;,&lt;br /&gt;
        placeholderLabel: &amp;quot;--Select a Year-- &amp;quot;,&lt;br /&gt;
        choiceLabels: local!data,&lt;br /&gt;
        choiceValues: local!data,&lt;br /&gt;
        value: if(&lt;br /&gt;
          isnull(&lt;br /&gt;
            local!selectedYear&lt;br /&gt;
          ),&lt;br /&gt;
          year(&lt;br /&gt;
            now()&lt;br /&gt;
          ),&lt;br /&gt;
          local!selectedYear&lt;br /&gt;
        ),&lt;br /&gt;
        saveInto: {&lt;br /&gt;
         local!selectedYear&lt;br /&gt;
        }&lt;br /&gt;
      )&lt;br /&gt;
    }&lt;br /&gt;
  )&lt;br /&gt;
)&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Dropdown null value issue</title><link>https://community.appian.com/thread/59513?ContentTypeID=1</link><pubDate>Fri, 24 Aug 2018 07:37:07 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:5cae73e8-7bce-4770-a1a3-eea2f29f1e17</guid><dc:creator>sauravk</dc:creator><description>This will work if(&lt;br /&gt;
rule!APN_isEmpty(ri!year),&lt;br /&gt;
a!save(ri!year,local!selectedCycleYear),&lt;br /&gt;
null&lt;br /&gt;
),&lt;br /&gt;
&lt;br /&gt;
Thanks for your inputs n follow up.&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Dropdown null value issue</title><link>https://community.appian.com/thread/59511?ContentTypeID=1</link><pubDate>Fri, 24 Aug 2018 07:03:44 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:6ea06701-85f7-4989-9b06-a96bb935d7a0</guid><dc:creator>Venkatesh Suram</dc:creator><description>&lt;p&gt;Please find below .&lt;/p&gt;
&lt;p&gt;Work Around-1:&lt;/p&gt;
&lt;p&gt;On click of Submit Button just check the below condition.&lt;/p&gt;
&lt;p&gt;if(&lt;br /&gt; rule!APN_isEmpty(ri!year),&lt;br /&gt; a!save(ri!year,local!selectedCycleYear),&lt;br /&gt; null&lt;br /&gt; ),&lt;/p&gt;
&lt;p&gt;Work Around-2:&lt;/p&gt;
&lt;p&gt;Pass ri!year value from Process Model it self[Before Attended node , Take the Current year], In this case no need to write extra code SAIL level.&lt;/p&gt;
&lt;p&gt;Thanks!!&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Dropdown null value issue</title><link>https://community.appian.com/thread/59509?ContentTypeID=1</link><pubDate>Fri, 24 Aug 2018 06:53:54 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:300b3969-ec11-479e-83c1-b5bd706c92de</guid><dc:creator>sauravk</dc:creator><description>I am trying to pass default selected value of drop down to rule input variable and further passing that variable to Process Modal. That ri!Variable is getting save on event basis in drop down. So if i don&amp;#39;t change anything in drop down and click on submit button that there would be nothing save in the ri!Variable. That&amp;#39;s why  ri!year is not displaying anything by default. But default selectedCycleYear value should be also save to this variable which is the problem here.&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Dropdown null value issue</title><link>https://community.appian.com/thread/59507?ContentTypeID=1</link><pubDate>Fri, 24 Aug 2018 05:39:03 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:02d0bc02-77bc-40e6-beb4-0e04972c1b9d</guid><dc:creator>Venkatesh Suram</dc:creator><description>&lt;a href="/members/sauravk"&gt;sauravk&lt;/a&gt; : Above code is working fine for me, What issue you are facing?&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Dropdown null value issue</title><link>https://community.appian.com/thread/59485?ContentTypeID=1</link><pubDate>Thu, 23 Aug 2018 12:37:34 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:531326ce-dbe1-480d-bcb9-d6caf911aa77</guid><dc:creator>sauravk</dc:creator><description>Plz find updated code.&lt;br /&gt;
&lt;br /&gt;
load(&lt;br /&gt;
  &lt;br /&gt;
  local!data: {&lt;br /&gt;
    {&lt;br /&gt;
      id: 1,&lt;br /&gt;
      name: &amp;quot;user1&amp;quot;,&lt;br /&gt;
      year: 2016&lt;br /&gt;
    },&lt;br /&gt;
    {&lt;br /&gt;
      id: 2,&lt;br /&gt;
      name: &amp;quot;user2&amp;quot;,&lt;br /&gt;
      year: 2017&lt;br /&gt;
    }&lt;br /&gt;
  },&lt;br /&gt;
  /*local!selectedYear: year(&lt;br /&gt;
    today()&lt;br /&gt;
  ),*/&lt;br /&gt;
  local!selectedCycleYear: year(&lt;br /&gt;
    today()&lt;br /&gt;
  ),&lt;br /&gt;
  local!dataSubset: todatasubset(&lt;br /&gt;
    local!data,&lt;br /&gt;
    a!pagingInfo(&lt;br /&gt;
      startIndex: 1,&lt;br /&gt;
      batchSize: - 1,&lt;br /&gt;
      sort: a!sortInfo(&lt;br /&gt;
        field: &amp;quot;year&amp;quot;,&lt;br /&gt;
        ascending: false&lt;br /&gt;
      )&lt;br /&gt;
    )&lt;br /&gt;
  ),&lt;br /&gt;
  local!year: if(&lt;br /&gt;
    rule!APN_isBlank(&lt;br /&gt;
      local!data&lt;br /&gt;
    ),&lt;br /&gt;
    {&lt;br /&gt;
      local!selectedCycleYear&lt;br /&gt;
    },&lt;br /&gt;
    rule!APN_distinct(&lt;br /&gt;
      append(&lt;br /&gt;
        tointeger(&lt;br /&gt;
          index(&lt;br /&gt;
            local!dataSubset.data,&lt;br /&gt;
            &amp;quot;year&amp;quot;,&lt;br /&gt;
            null&lt;br /&gt;
          ),&lt;br /&gt;
          local!selectedCycleYear&lt;br /&gt;
        )&lt;br /&gt;
      )&lt;br /&gt;
    )&lt;br /&gt;
  ),&lt;br /&gt;
  a!formLayout(&lt;br /&gt;
    contents: {&lt;br /&gt;
      a!dropdownField(&lt;br /&gt;
        label: &amp;quot;Year&amp;quot;,&lt;br /&gt;
        labelPosition: &amp;quot;ABOVE&amp;quot;,&lt;br /&gt;
        /*placeholderLabel: &amp;quot;--Select a Year-- &amp;quot;,*/&lt;br /&gt;
        choiceLabels: local!Year,&lt;br /&gt;
        choiceValues: local!Year,&lt;br /&gt;
        value: local!selectedCycleYear,&lt;br /&gt;
        saveInto: {&lt;br /&gt;
          local!selectedCycleYear,&lt;br /&gt;
          a!save(ri!year,local!selectedCycleYear)&lt;br /&gt;
        }&lt;br /&gt;
      ),&lt;br /&gt;
      a!textField(label:&amp;quot;Debug local!selectedCycleYear&amp;quot;,value:ri!year,readOnly: true())&lt;br /&gt;
    }&lt;br /&gt;
  )&lt;br /&gt;
)&lt;br /&gt;
&lt;br /&gt;
Have a look its not able to assign value in rule input variable. Sorry i forgot to add this in previous chat. I was about to ask this only. By mistake add wrong variable name.&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Dropdown null value issue</title><link>https://community.appian.com/thread/59479?ContentTypeID=1</link><pubDate>Thu, 23 Aug 2018 11:52:09 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:d7ee2629-fa35-4dbc-baee-8dab65a9394b</guid><dc:creator>Venkatesh Suram</dc:creator><description>&lt;p&gt;Can you have look now.&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;load(
  
  local!data: {
    {
      id: 1,
      name: &amp;quot;user1&amp;quot;,
      year: 2016
    },
    {
      id: 2,
      name: &amp;quot;user2&amp;quot;,
      year: 2017
    }
  },
  /*local!selectedYear: year(
    today()
  ),*/
  local!selectedCycleYear: year(
    today()
  ),
  local!dataSubset: todatasubset(
    local!data,
    a!pagingInfo(
      startIndex: 1,
      batchSize: - 1,
      sort: a!sortInfo(
        field: &amp;quot;year&amp;quot;,
        ascending: false
      )
    )
  ),
  local!year: if(
    rule!APN_isBlank(
      local!data
    ),
    {
      local!selectedCycleYear
    },
    rule!APN_distinct(
      append(
        tointeger(
          index(
            local!dataSubset.data,
            &amp;quot;year&amp;quot;,
            null
          ),
          local!selectedCycleYear
        )
      )
    )
  ),
  a!formLayout(
    contents: {
      a!dropdownField(
        label: &amp;quot;Year&amp;quot;,
        labelPosition: &amp;quot;ABOVE&amp;quot;,
        /*placeholderLabel: &amp;quot;--Select a Year-- &amp;quot;,*/
        choiceLabels: local!Year,
        choiceValues: local!Year,
        value: local!selectedCycleYear,
        saveInto: {
          local!selectedCycleYear
        }
      ),
      a!textField(label:&amp;quot;Debug local!selectedCycleYear&amp;quot;,value:local!selectedCycleYear,readOnly: true())
    }
  )
)&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;What is Diff b/w local!selectedYearand local!selectedCycleYear , If above code is fine Just remove unnecessary local variables&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Dropdown null value issue</title><link>https://community.appian.com/thread/59478?ContentTypeID=1</link><pubDate>Thu, 23 Aug 2018 11:19:14 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:f8e2833d-3559-45df-9917-c95e857dfa68</guid><dc:creator>sauravk</dc:creator><description>&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;load(
  local!data: {
    {
      id: 1,
      name: &amp;quot;user1&amp;quot;,
      year: 2016
    },
    {
      id: 2,
      name: &amp;quot;user2&amp;quot;,
      year: 2017
    }
  },
  local!selectedYear: year(
    today()
  ),
  local!selectedCycleYear,
  local!dataSubset: todatasubset(
    local!data,
    a!pagingInfo(
      startIndex: 1,
      batchSize: - 1,
      sort: a!sortInfo(
        field: &amp;quot;year&amp;quot;,
        ascending: false
      )
    )
  ),
  local!year: if(
    rule!APN_isBlank(
      local!data
    ),
    {},
    rule!APN_distinct(
      append(
        tointeger(
          index(
            local!dataSubset.data,
            &amp;quot;year&amp;quot;,
            null
          ),
          local!selectedYear
        )
      )
    )
  ),
  a!formLayout(
    contents: {
      a!dropdownField(
        label: &amp;quot;Year&amp;quot;,
        labelPosition: &amp;quot;ABOVE&amp;quot;,
        /*placeholderLabel: &amp;quot;--Select a Year-- &amp;quot;,*/
        choiceLabels: local!Year,
        choiceValues: local!Year,
        value: local!selectedYear,
        saveInto: {
          local!selectedCycleYear
        }
      ),
      a!textField(local!selectedCycleYear)
    }
  )
)&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;I got one issue in this code. local!selectedCycleYear value is not saving for 2018 for rest year it is getting save.&lt;br /&gt; Plz add this a!textField(local!selectedCycleYear) n you will see result.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Dropdown null value issue</title><link>https://community.appian.com/thread/59475?ContentTypeID=1</link><pubDate>Thu, 23 Aug 2018 09:36:15 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:ac5d7708-6793-4b6a-beda-0779a806e4e5</guid><dc:creator>sauravk</dc:creator><description>Thanks a lot.&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Dropdown null value issue</title><link>https://community.appian.com/thread/59473?ContentTypeID=1</link><pubDate>Thu, 23 Aug 2018 09:24:30 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:ef32ee16-fa8d-46ae-a796-458d09530f0d</guid><dc:creator>Krishna Chaitanya</dc:creator><description>Can you try below code &lt;br /&gt;
&lt;br /&gt;
load(&lt;br /&gt;
  local!currentYear:year(today()),&lt;br /&gt;
  local!years: append(&lt;br /&gt;
    a!forEach(&lt;br /&gt;
      {&lt;br /&gt;
        10,&lt;br /&gt;
        9,&lt;br /&gt;
        8,&lt;br /&gt;
        7,&lt;br /&gt;
        6,&lt;br /&gt;
        5,&lt;br /&gt;
        4,&lt;br /&gt;
        3,&lt;br /&gt;
        2,&lt;br /&gt;
        1&lt;br /&gt;
      },&lt;br /&gt;
      local!currentYear - fv!item&lt;br /&gt;
    ),&lt;br /&gt;
    local!currentYear,&lt;br /&gt;
    a!forEach(&lt;br /&gt;
      {&lt;br /&gt;
        1,&lt;br /&gt;
        2,&lt;br /&gt;
        3,&lt;br /&gt;
        4,&lt;br /&gt;
        5,&lt;br /&gt;
        6,&lt;br /&gt;
        7,&lt;br /&gt;
        8,&lt;br /&gt;
        9,&lt;br /&gt;
        10&lt;br /&gt;
      },&lt;br /&gt;
      fv!item + local!currentYear&lt;br /&gt;
    )&lt;br /&gt;
  ),&lt;br /&gt;
  local!selectedYear:local!currentYear,&lt;br /&gt;
  a!dropdownField(&lt;br /&gt;
    label: &amp;quot;Year&amp;quot;,&lt;br /&gt;
    labelPosition: &amp;quot;ABOVE&amp;quot;,&lt;br /&gt;
    placeholderLabel: &amp;quot;--Select a Year-- &amp;quot;,&lt;br /&gt;
    choiceLabels: local!years,&lt;br /&gt;
    choiceValues: local!years,&lt;br /&gt;
    value:local!selectedYear,&lt;br /&gt;
    saveInto: local!selectedYear&lt;br /&gt;
  )&lt;br /&gt;
)&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Dropdown null value issue</title><link>https://community.appian.com/thread/59472?ContentTypeID=1</link><pubDate>Thu, 23 Aug 2018 09:21:59 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:01b186e5-3d35-4e60-9033-677e0f4891c5</guid><dc:creator>Venkatesh Suram</dc:creator><description>&lt;p&gt;@sauravk: Can you please try below code snippet.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;load(&lt;br /&gt; local!data:{&lt;br /&gt; {id:1,name:&amp;quot;user1&amp;quot;,year:2016},&lt;br /&gt; {id:2,name:&amp;quot;user2&amp;quot;,year:2017}&lt;br /&gt; },&lt;br /&gt; local!selectedYear:year(&lt;br /&gt; today()&lt;br /&gt; ),&lt;br /&gt; local!selectedCycleYear,&lt;br /&gt; local!dataSubset:todatasubset(&lt;br /&gt; local!data,&lt;br /&gt; a!pagingInfo(&lt;br /&gt; startIndex: 1,&lt;br /&gt; batchSize: - 1,&lt;br /&gt; sort: a!sortInfo(&lt;br /&gt; field: &amp;quot;year&amp;quot;,&lt;br /&gt; ascending: false&lt;br /&gt; )&lt;br /&gt; )&lt;br /&gt; ), &lt;br /&gt; local!year: if(&lt;br /&gt; rule!APN_isBlank(&lt;br /&gt; local!data&lt;br /&gt; ),&lt;br /&gt; {},&lt;br /&gt; rule!APN_distinct(append(&lt;br /&gt; tointeger(&lt;br /&gt; index(&lt;br /&gt; local!dataSubset.data,&amp;quot;year&amp;quot;,null),&lt;br /&gt; local!selectedYear&lt;br /&gt; )&lt;br /&gt; ))&lt;br /&gt; ),&lt;br /&gt; a!formLayout(&lt;br /&gt; contents: {&lt;br /&gt; a!dropdownField(&lt;br /&gt; label: &amp;quot;Year&amp;quot;,&lt;br /&gt; labelPosition: &amp;quot;ABOVE&amp;quot;,&lt;br /&gt; /*placeholderLabel: &amp;quot;--Select a Year-- &amp;quot;,*/&lt;br /&gt; choiceLabels: local!Year,&lt;br /&gt; choiceValues: local!Year,&lt;br /&gt; value: local!selectedYear,&lt;br /&gt; saveInto: {&lt;br /&gt; local!selectedCycleYear&lt;br /&gt; }&lt;br /&gt; )&lt;br /&gt; }&lt;br /&gt; )&lt;br /&gt;)&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Dropdown null value issue</title><link>https://community.appian.com/thread/59471?ContentTypeID=1</link><pubDate>Thu, 23 Aug 2018 09:21:05 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:d3994b2c-07e9-44ea-bebf-97a4ce877f23</guid><dc:creator>sauravk</dc:creator><description>if(isnull(local!selectedYear),{},dropdown()) here i have assigned current year to selectedYear but its completing  hiding that dropdown.&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Dropdown null value issue</title><link>https://community.appian.com/thread/59469?ContentTypeID=1</link><pubDate>Thu, 23 Aug 2018 09:16:05 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:b58a7af6-fc5e-4925-a6ec-a6226136ed3c</guid><dc:creator>sauravk</dc:creator><description>can you share one liner code or modify this code as per your approach if possible&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Dropdown null value issue</title><link>https://community.appian.com/thread/59468?ContentTypeID=1</link><pubDate>Thu, 23 Aug 2018 09:13:29 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:1a95f86d-92d4-4070-a987-1ea615122aee</guid><dc:creator>Shanmukha</dc:creator><description>Hi Saurav,&lt;br /&gt;
&lt;br /&gt;
local!Year is list of years which contain current year (which you wan to be selected when form is loaded) right? If yes then did you try assigning the local!selectedYear=current year (which you wan to be selected when form is loaded) ?&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Dropdown null value issue</title><link>https://community.appian.com/thread/59467?ContentTypeID=1</link><pubDate>Thu, 23 Aug 2018 09:03:03 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:9053631d-d858-49ba-9efd-76dc2b64f3ff</guid><dc:creator>sauravk</dc:creator><description>I tried to put null check also before this dropdown but after that its not showing this dropdown in case of  local!selectedCycleYear null check and when i tried with local!year null than nothing is getting impact same error is coming.&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>