<?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>Can we display value in drop down based on conditions</title><link>https://community.appian.com/discussions/f/general/21657/can-we-display-value-in-drop-down-based-on-conditions</link><description>In drop down  choice labels and choice value ..can we display value based on if conditions.. 
 I need to display value in drop down based on the product availability.. 
 And I have around 10 products 
 Can someone help with codes</description><dc:language>en-US</dc:language><generator>Telligent Community 12</generator><item><title>RE: Can we display value in drop down based on conditions</title><link>https://community.appian.com/thread/84698?ContentTypeID=1</link><pubDate>Tue, 17 Aug 2021 22:49:47 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:389c4668-d688-45ab-8f7b-7d473888337d</guid><dc:creator>Mike Schmitt</dc:creator><description>&lt;p&gt;I (or someone else) can do that, but you&amp;#39;d need to provide some more details first.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Can you clarify what you mean when you say your dropdown is &amp;quot;inside for loop&amp;quot;?&amp;nbsp;&lt;/li&gt;
&lt;li&gt;How is the value of &lt;em&gt;local!quantity&lt;/em&gt; set, and what value(s) will it / could it contain?&lt;/li&gt;
&lt;li&gt;What exactly are you hoping to have happen in your if() statement, i.e. &amp;quot;if(local!quantity &amp;lt; cons!QUANTITY...&amp;quot; etc?&amp;nbsp; In other words, I&amp;#39;m unclear both what you&amp;#39;re expecting that to resolve to, and i&amp;#39;m unclear what your expectations would be about the choice labels that end up being displayed from it.&lt;/li&gt;
&lt;/ul&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Can we display value in drop down based on conditions</title><link>https://community.appian.com/thread/84697?ContentTypeID=1</link><pubDate>Tue, 17 Aug 2021 22:00:58 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:3de27fc8-dd6d-488f-8fb0-bdc298f92f8a</guid><dc:creator>Radha009</dc:creator><description>&lt;p&gt;Thanks Mike... It would be of great help if you can provide any working code &lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Can we display value in drop down based on conditions</title><link>https://community.appian.com/thread/84695?ContentTypeID=1</link><pubDate>Tue, 17 Aug 2021 19:45:13 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:c9c24b74-5e9a-44d5-a3d8-bb6979b6d718</guid><dc:creator>Mike Schmitt</dc:creator><description>&lt;p&gt;Well there&amp;#39;s your first problem - choiceLabels and choiceValues are both arrays, and they must &lt;em&gt;&lt;strong&gt;always exactly match in length&lt;/strong&gt;&lt;/em&gt;&lt;strong&gt;&lt;/strong&gt;.&amp;nbsp; &amp;quot;Labels&amp;quot; is what the user sees and &amp;quot;Values&amp;quot; is what&amp;#39;s saved when the corresponding entry is selected.&amp;nbsp; If you&amp;#39;re going to conditionally show/hide members in the dropdown, you must do the exact same transformation on the lists you&amp;#39;re passing on for &lt;em&gt;&lt;strong&gt;both&lt;/strong&gt;&lt;/em&gt;.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Can we display value in drop down based on conditions</title><link>https://community.appian.com/thread/84694?ContentTypeID=1</link><pubDate>Tue, 17 Aug 2021 19:29:58 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:a730b2eb-593a-47b5-860d-cb34092df2a1</guid><dc:creator>Radha009</dc:creator><description>&lt;p&gt;Drop down field(&lt;/p&gt;
&lt;p&gt;Label:&amp;#39;&amp;#39;available&amp;quot;&lt;/p&gt;
&lt;p&gt;Choice labels: if (local! quantity&amp;lt;cons! QUANTITY), local! quantity,&amp;#123;&amp;#125;),&lt;/p&gt;
&lt;p&gt;Choice value: cons! QUANTITY,&lt;/p&gt;
&lt;p&gt;Value: local!data,&lt;/p&gt;
&lt;p&gt;Saveinto: local! data,&lt;/p&gt;
&lt;p&gt;)&lt;/p&gt;
&lt;p&gt;Cons! QUANTITY: It has value &amp;#123;1,2,3,4..10&amp;#125;&lt;/p&gt;
&lt;p&gt;My drop-down is inside for loop.&lt;/p&gt;
&lt;p&gt;When am using same if condition in choice value it&amp;#39;s throwing error.&lt;/p&gt;
&lt;p&gt;What am trying is if the product is available less than 10 then only that no. Should display as drop down value.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Can we display value in drop down based on conditions</title><link>https://community.appian.com/thread/84690?ContentTypeID=1</link><pubDate>Tue, 17 Aug 2021 19:17:51 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:45cb10b1-4cb7-4dd7-a111-0ab7cfc85a55</guid><dc:creator>Mike Schmitt</dc:creator><description>&lt;p&gt;Can you provide some more details?&amp;nbsp; What are the logical conditions under which you&amp;#39;re expecting to see different dropdown choices?&amp;nbsp; Are these conditions affected by other on-form elements (i.e. dynamically changeable by the user), or decided beforehand so the values on the form in question will be relatively static?&amp;nbsp; There are different implementation patterns depending on the answers to these questions (among others).&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>