<?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>Displaying unique value in dropdown</title><link>https://community.appian.com/discussions/f/user-interface/38914/displaying-unique-value-in-dropdown</link><description>I have 2 dropdowns type and courses type will be premium, free and courses for premium java, c++, and also for free also I have java , python like this . i need to display all the courses when in default and when type selected as premium it will only</description><dc:language>en-US</dc:language><generator>Telligent Community 12</generator><item><title>RE: Displaying unique value in dropdown</title><link>https://community.appian.com/thread/147240?ContentTypeID=1</link><pubDate>Tue, 15 Apr 2025 21:33:41 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:c5797a3c-b61a-4e7f-a2b3-602970486e9a</guid><dc:creator>Mike Schmitt</dc:creator><description>&lt;p&gt;If both &amp;quot;java&amp;quot; entries have single, unique type IDs, does that imply that the two different &amp;quot;Java&amp;quot; offerings are actually different (as in, it sounds like there are 2 separate entries in your DB)?&amp;nbsp; In that case maybe you should consider changing the label for one of them to be distinct, like &amp;quot;Java (premium)&amp;quot;, etc.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Displaying unique value in dropdown</title><link>https://community.appian.com/thread/147214?ContentTypeID=1</link><pubDate>Tue, 15 Apr 2025 09:33:18 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:26c1929d-1698-4771-8dbe-1e3e41411a80</guid><dc:creator>Vyshnavi Naripeddi</dc:creator><description>&lt;p&gt;Hi&amp;nbsp;&lt;a href="/members/iswaryan3555"&gt;iswarya2812&lt;/a&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;a!dropdownField&lt;/strong&gt;&amp;nbsp;should have unique choice values, I would suggest you to show the course type first and then showing courses based on the selected course type or&amp;nbsp;else you can also use&amp;nbsp;&lt;strong&gt;a!dropdownFieldByIndex&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;Refer to : &lt;a href="https://docs.appian.com/suite/help/24.2/Dropdown_By_Index_Component.html"&gt;https://docs.appian.com/suite/help/24.2/Dropdown_By_Index_Component.html&lt;/a&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Displaying unique value in dropdown</title><link>https://community.appian.com/thread/147205?ContentTypeID=1</link><pubDate>Tue, 15 Apr 2025 06:11:43 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:cc214254-7cf2-4cc2-90f4-f558df72624e</guid><dc:creator>Stefan Helzle</dc:creator><description>&lt;p&gt;OK, so this is not about a consecutive selection, but the first dropdown is meant to filter the second.&lt;/p&gt;
&lt;p&gt;You could use the dropDownByIndex. You store&amp;nbsp;your actual records to a local variable and derive the choice labels from them. When the user makes a selection, you get the index of the selected item.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Displaying unique value in dropdown</title><link>https://community.appian.com/thread/147200?ContentTypeID=1</link><pubDate>Tue, 15 Apr 2025 05:32:59 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:59390fcc-7297-4986-bb03-279b120c199f</guid><dc:creator>Teja Kunchala</dc:creator><description>&lt;p&gt;As per my understanding on what you said. You are having a table that contains the courses like this&amp;nbsp;&lt;br /&gt;CourseId&amp;nbsp; Course&amp;nbsp; &amp;nbsp; &amp;nbsp;Type&lt;br /&gt;1&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Java&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Premium&lt;/p&gt;
&lt;p&gt;2&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Java&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Free&lt;br /&gt;&lt;br /&gt;So from this table only you are going to get the courses and displaying them in drop-down right?&lt;br /&gt;You are trying union on courses that is choice labels and unable to use union on choice values that is courseId.&lt;br /&gt;If this is the case I have some doubts&lt;/p&gt;
&lt;p&gt;1.Why you want to show all the courses in drop-down before selecting type?&lt;/p&gt;
&lt;p&gt;&lt;span style="font-family:inherit;"&gt;2.What you want to store as type premium or free when no type is selected and you are selecting the course?&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-family:inherit;"&gt;If no type is selected and if you want to store free then you can have the choice values {2} instead of {1,2} by using wherecontains and index.&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Displaying unique value in dropdown</title><link>https://community.appian.com/thread/147199?ContentTypeID=1</link><pubDate>Tue, 15 Apr 2025 05:04:38 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:53025194-ab4d-4ab8-9206-95adb045ecc5</guid><dc:creator>iswarya2812</dc:creator><description>&lt;p&gt;Will try this.Thanks.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Displaying unique value in dropdown</title><link>https://community.appian.com/thread/147188?ContentTypeID=1</link><pubDate>Mon, 14 Apr 2025 13:49:10 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:04ef6103-691d-4ef1-9935-a8aa9f9a2b0f</guid><dc:creator>Zakary Melvin</dc:creator><description>&lt;p&gt;When I read &amp;quot;unique&amp;quot; my first thought is the union() function.&amp;nbsp; I&amp;#39;m not sure where you&amp;#39;re dropdown values come from or how your objects are configured, but you could try something like below...&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;a!localVariables(
  
  local!selectedType,
  local!selectedCourse,
  local!dropdownOptionsMap: {
    a!map(course: &amp;quot;Java&amp;quot;, type: &amp;quot;Premium&amp;quot;),
    a!map(course: &amp;quot;C++&amp;quot;, type: &amp;quot;Premium&amp;quot;),
    a!map(course: &amp;quot;Appian&amp;quot;, type: &amp;quot;Premium&amp;quot;),
    a!map(course: &amp;quot;Java&amp;quot;, type: &amp;quot;Free&amp;quot;),
    a!map(course: &amp;quot;Python&amp;quot;, type: &amp;quot;Free&amp;quot;),
    a!map(course: &amp;quot;Javascript&amp;quot;, type: &amp;quot;Free&amp;quot;),
  },
  
  local!allCourseOptions: union(local!dropdownOptionsMap.course,local!dropdownOptionsMap.course),
  
  local!courseOptions: if(
    a!isNotNullOrEmpty(local!selectedType),
    index(local!dropdownOptionsMap, wherecontains(local!selectedType, local!dropdownOptionsMap.type)).course,
    local!allCourseOptions
  ),
  
  
  {
    a!dropdownField(
      label: &amp;quot;Course Type&amp;quot;,
      placeholder: &amp;quot;Select Course Type&amp;quot;,
      choiceLabels: union(local!dropdownOptionsMap.type,local!dropdownOptionsMap.type),
      choiceValues: union(local!dropdownOptionsMap.type,local!dropdownOptionsMap.type),
      value: local!selectedType,
      saveInto: {
        local!selectedType,
        a!save(local!selectedCourse, null)
      }
    ),
    a!dropdownField(
      label: &amp;quot;Course&amp;quot;,
      placeholder: &amp;quot;Select Course&amp;quot;,
      choiceLabels: local!courseOptions,
      choiceValues: local!courseOptions,
      value: local!selectedCourse,
      saveInto: {
        local!selectedCourse,
        a!save(
          local!selectedType,
          if(
            and(
              a!isNotNullOrEmpty(save!value),
              length(
                index(
                  local!dropdownOptionsMap,
                  wherecontains(
                    save!value,
                    local!dropdownOptionsMap.course
                  )
                ).type
              ) = 1
            ),
            index(
              local!dropdownOptionsMap,
              wherecontains(
                save!value,
                local!dropdownOptionsMap.course
              )
            ).type,
            null
          )
        )
      }
    )
  }
)&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;The list of course options begins with all unique values in the local!dropdownOptionsMap.course.&amp;nbsp; Notice Java is listed twice in local!dropdownOptionsMap.course.&amp;nbsp; To get the unique list I just used union(local!dropdownOptionsMap.course,&amp;nbsp;&lt;span&gt;local!dropdownOptionsMap.course).&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Added some&amp;nbsp;logic in course selection to s&lt;/span&gt;&lt;span&gt;et the type if the selected course is unique in&amp;nbsp;the list of options and logic in the type selection to clear away any previously selected course.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Hope this helps!&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Displaying unique value in dropdown</title><link>https://community.appian.com/thread/147182?ContentTypeID=1</link><pubDate>Mon, 14 Apr 2025 12:41:38 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:9ad9dea7-1712-40df-9aee-4d55f7b1900a</guid><dc:creator>iswarya2812</dc:creator><description>&lt;p&gt;But what I want is to display all the unique courses by default when no type is selected.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Displaying unique value in dropdown</title><link>https://community.appian.com/thread/147181?ContentTypeID=1</link><pubDate>Mon, 14 Apr 2025 12:37:56 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:c0348242-aebb-4d22-b2fc-7e5898b2fa03</guid><dc:creator>Stefan Helzle</dc:creator><description>&lt;p&gt;That&amp;#39;s the idea. Using showWhen, you can hide/display the second dropDown based on the selected type.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Displaying unique value in dropdown</title><link>https://community.appian.com/thread/147180?ContentTypeID=1</link><pubDate>Mon, 14 Apr 2025 12:29:07 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:88842794-2807-4922-be6f-4cfdb067a8d9</guid><dc:creator>iswarya2812</dc:creator><description>&lt;p&gt;Are you are saying like one dropdown named courses for premium, other one is courses for free. I am not sure we can do&amp;nbsp;like that.&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Displaying unique value in dropdown</title><link>https://community.appian.com/thread/147179?ContentTypeID=1</link><pubDate>Mon, 14 Apr 2025 11:55:57 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:79e4f22b-5633-4ba7-a5ed-f081dfefb8dc</guid><dc:creator>Stefan Helzle</dc:creator><description>&lt;p&gt;Would it be possible to create two dropdowns for courses, and show one of them depending on the type?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>