{"id":5010,"date":"2015-11-12T20:20:53","date_gmt":"2015-11-12T20:20:53","guid":{"rendered":"http:\/\/www.jitendrazaa.com\/blog\/?p=5010"},"modified":"2015-11-16T19:03:46","modified_gmt":"2015-11-16T19:03:46","slug":"creating-none-required-dropdown-field-in-flow","status":"publish","type":"post","link":"https:\/\/www.jitendrazaa.com\/blog\/salesforce\/creating-none-required-dropdown-field-in-flow\/","title":{"rendered":"Non mandatory dropdown field in Flow"},"content":{"rendered":"<p style=\"text-align: justify;\">I have been working on Salesforce flow for a time now and faced many challenges. I always had an option to use Visualforce page however Flow is fun and powerful. <a href=\"https:\/\/www.jitendrazaa.com\/blog\/salesforce\/creating-two-column-layout-in-flow\/\">In previous article <\/a>, I\u00a0have explained how we can create two column layout in flow, which was very easy to use.<\/p>\n<p style=\"text-align: justify;\">Recently, I came to know that we cannot create none required dropdown field in Flow. So <a href=\"https:\/\/success.salesforce.com\/ideaView?id=08730000000l5LcAAI&amp;sort=2\">please vote this idea<\/a> so that we will not need this workaround.<\/p>\n<p style=\"text-align: justify;\">Making none mandatory dropdown field is very easy and you don&#8217;t need to know any coding, just follow below simple steps:<\/p>\n<ol>\n<li style=\"text-align: justify;\">Download JQuery and save it as a static resource by name &#8220;JQuery&#8221;.<\/li>\n<li style=\"text-align: justify;\">Copy below Visualforce page<\/li>\n<li style=\"text-align: justify;\">Replace\u00a0&#8220;flow:interview&#8221; name by your flow name<\/li>\n<li style=\"text-align: justify;\">If you are expecting any URL parameter then simply add it as &#8220;apex:param&#8221; as shown in code<\/li>\n<li style=\"text-align: justify;\">Add your field names which does not need to be mandatory in variable &#8220;nonMandatory&#8221;<\/li>\n<li style=\"text-align: justify;\">In your Flow, add &#8220;&#8211; None &#8211;&#8221; as first choice in dropdown<\/li>\n<\/ol>\n<p>Lets repeat above steps in detail with an example.<!--more--><\/p>\n<p>Assume, that I have below Screen in my flow<\/p>\n<figure id=\"attachment_5011\" aria-describedby=\"caption-attachment-5011\" style=\"width: 871px\" class=\"wp-caption aligncenter\"><a href=\"https:\/\/i0.wp.com\/www.jitendrazaa.com\/blog\/wp-content\/uploads\/2015\/11\/Saleforce-Flow-Screen-with-some-input-fields.png?ssl=1\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" class=\"wp-image-5011 size-full\" src=\"https:\/\/i0.wp.com\/www.jitendrazaa.com\/blog\/wp-content\/uploads\/2015\/11\/Saleforce-Flow-Screen-with-some-input-fields.png?resize=871%2C518&#038;ssl=1\" alt=\"Salesforce Flow Screen with some input fields\" width=\"871\" height=\"518\" srcset=\"https:\/\/i0.wp.com\/www.jitendrazaa.com\/blog\/wp-content\/uploads\/2015\/11\/Saleforce-Flow-Screen-with-some-input-fields.png?w=871&amp;ssl=1 871w, https:\/\/i0.wp.com\/www.jitendrazaa.com\/blog\/wp-content\/uploads\/2015\/11\/Saleforce-Flow-Screen-with-some-input-fields.png?resize=300%2C178&amp;ssl=1 300w, https:\/\/i0.wp.com\/www.jitendrazaa.com\/blog\/wp-content\/uploads\/2015\/11\/Saleforce-Flow-Screen-with-some-input-fields.png?resize=624%2C371&amp;ssl=1 624w\" sizes=\"auto, (max-width: 871px) 100vw, 871px\" \/><\/a><figcaption id=\"caption-attachment-5011\" class=\"wp-caption-text\">Salesforce Flow Screen with some input fields<\/figcaption><\/figure>\n<p>Make sure, flow which you don&#8217;t want to be required has &#8220;&#8211; None &#8211;&#8221; value as shown below<\/p>\n<figure id=\"attachment_5012\" aria-describedby=\"caption-attachment-5012\" style=\"width: 499px\" class=\"wp-caption aligncenter\"><a href=\"https:\/\/i0.wp.com\/www.jitendrazaa.com\/blog\/wp-content\/uploads\/2015\/11\/Create-None-Option-with-Blank-Stored-Value-for-Dropdown-List-in-Flow.png?ssl=1\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-5012\" src=\"https:\/\/i0.wp.com\/www.jitendrazaa.com\/blog\/wp-content\/uploads\/2015\/11\/Create-None-Option-with-Blank-Stored-Value-for-Dropdown-List-in-Flow.png?resize=499%2C263&#038;ssl=1\" alt=\"Create None Option with Blank Stored Value for Dropdown List in Flow\" width=\"499\" height=\"263\" srcset=\"https:\/\/i0.wp.com\/www.jitendrazaa.com\/blog\/wp-content\/uploads\/2015\/11\/Create-None-Option-with-Blank-Stored-Value-for-Dropdown-List-in-Flow.png?w=499&amp;ssl=1 499w, https:\/\/i0.wp.com\/www.jitendrazaa.com\/blog\/wp-content\/uploads\/2015\/11\/Create-None-Option-with-Blank-Stored-Value-for-Dropdown-List-in-Flow.png?resize=300%2C158&amp;ssl=1 300w\" sizes=\"auto, (max-width: 499px) 100vw, 499px\" \/><\/a><figcaption id=\"caption-attachment-5012\" class=\"wp-caption-text\">Create None Option with Blank Stored Value for Dropdown List in Flow<\/figcaption><\/figure>\n<p>Save this flow and mark screen as starting element<\/p>\n<figure id=\"attachment_5013\" aria-describedby=\"caption-attachment-5013\" style=\"width: 252px\" class=\"wp-caption aligncenter\"><a href=\"https:\/\/i0.wp.com\/www.jitendrazaa.com\/blog\/wp-content\/uploads\/2015\/11\/Salesforce-Flow-Designer.png?ssl=1\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-5013\" src=\"https:\/\/i0.wp.com\/www.jitendrazaa.com\/blog\/wp-content\/uploads\/2015\/11\/Salesforce-Flow-Designer.png?resize=252%2C161&#038;ssl=1\" alt=\"Salesforce Flow Designer\" width=\"252\" height=\"161\" \/><\/a><figcaption id=\"caption-attachment-5013\" class=\"wp-caption-text\">Salesforce Flow Designer<\/figcaption><\/figure>\n<p>In my case , Flow name is saved as &#8220;Non_Required_Dropdi&#8221;. Currently you cannot change unique name of flow and its automatically generated, <a href=\"https:\/\/success.salesforce.com\/ideaView?id=08730000000DvVwAAK\">please vote this idea<\/a> if you want ability to change it later.<\/p>\n<p>Create a Visualforce page with below code<\/p>\n<pre class=\"brush: xml; highlight: [4,17]; title: ; notranslate\" title=\"\">\r\n&lt;apex:page&gt;\r\n    &lt;apex:includeScript value=&quot;{!$Resource.JQuery}&quot;\/&gt;    \r\n\t&lt;!-- replace below name by your flow Name --&gt;\r\n    &lt;flow:interview name=&quot;Non_Required_Dropdi&quot; finishLocation=&quot;\/{!$CurrentPage.parameters.id}&quot;&gt;\r\n        &lt;apex:param name=&quot;varParameter1&quot; value=&quot;{!$CurrentPage.parameters.sampleParameter}&quot;\/&gt; \r\n    &lt;\/flow:interview&gt;    \r\n    &lt;!-- fields in flow does not has good padding, so add some extra --&gt;\r\n&lt;style type=&quot;text\/css&quot;&gt;\r\n        .dataCol, .labelCol{\r\n        \t    padding-top: 5px !important;\r\n    \t\t\tpadding-bottom: 5px !important;\r\n        }\r\n    &lt;\/style&gt; \r\n    &lt;script type=&quot;text\/javascript&quot;&gt;     \r\n        $(function(){\r\n            \/* add name of fields from flow mark as none mandatory *\/\r\n        \tvar nonMandatoryIds = &#x5B;&quot;Non_Required_Dropdown_List&quot;,&quot;field2Name&quot;];\r\n            \r\n            for(var i = 0; i &lt; nonMandatoryIds.length ; i++){\r\n                removeRequiredMark(nonMandatoryIds&#x5B;i]);\r\n            }            \r\n        });    \r\n    \tfunction removeRequiredMark(fieldId){           \t\r\n            $('select&#x5B;id*='+fieldId+']').each(function() { \r\n                $(this).parent().find(&quot;.requiredBlock&quot;).remove();\r\n            });\r\n         }\r\n    &lt;\/script&gt;\r\n&lt;\/apex:page&gt;\r\n<\/pre>\n<p>In above code at line 5, we need to add flow unique name. On line 25, we need to add comma separated names of field from flow to mark as none required.<\/p>\n<p>Below is final output of flow, as we can see field by name &#8220;Non_Required_Dropdown_List&#8221; is not marked as mandatory.<\/p>\n<figure id=\"attachment_5015\" aria-describedby=\"caption-attachment-5015\" style=\"width: 603px\" class=\"wp-caption aligncenter\"><a href=\"https:\/\/i0.wp.com\/www.jitendrazaa.com\/blog\/wp-content\/uploads\/2015\/11\/Salesforce-flow-Output.png?ssl=1\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-5015\" src=\"https:\/\/i0.wp.com\/www.jitendrazaa.com\/blog\/wp-content\/uploads\/2015\/11\/Salesforce-flow-Output.png?resize=603%2C298&#038;ssl=1\" alt=\"Salesforce flow Output\" width=\"603\" height=\"298\" srcset=\"https:\/\/i0.wp.com\/www.jitendrazaa.com\/blog\/wp-content\/uploads\/2015\/11\/Salesforce-flow-Output.png?w=603&amp;ssl=1 603w, https:\/\/i0.wp.com\/www.jitendrazaa.com\/blog\/wp-content\/uploads\/2015\/11\/Salesforce-flow-Output.png?resize=300%2C148&amp;ssl=1 300w\" sizes=\"auto, (max-width: 603px) 100vw, 603px\" \/><\/a><figcaption id=\"caption-attachment-5015\" class=\"wp-caption-text\">Salesforce flow Output<\/figcaption><\/figure>\n","protected":false},"excerpt":{"rendered":"<p>Creating Non Mandatory dropdown field in Salesforce flow<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"advanced_seo_description":"","jetpack_seo_html_title":"","jetpack_seo_noindex":false,"jetpack_post_was_ever_published":false,"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"jz_research_post":"","_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[9],"tags":[352],"class_list":["post-5010","post","type-post","status-publish","format-standard","hentry","category-salesforce","tag-flow"],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"jetpack-related-posts":[{"id":4967,"url":"https:\/\/www.jitendrazaa.com\/blog\/salesforce\/salesforce-flow-interview-questions-for-admins-part-23\/","url_meta":{"origin":5010,"position":0},"title":"Salesforce Flow Interview Questions for admins &#8211; Part 23","author":"Jitendra","date":"December 7, 2015","format":false,"excerpt":"\ufeff Consider it interview questions or FAQs, However below are some high level information or gotchas related to Salesforce Flow. 221. How to create lookup field in Salesforce flow? Ans : There is no direct way to create a lookup field in flow but we can use workaround mentioned in\u2026","rel":"","context":"In &quot;Salesforce&quot;","block_context":{"text":"Salesforce","link":"https:\/\/www.jitendrazaa.com\/blog\/category\/salesforce\/"},"img":{"alt_text":"Sample Salesforce flow using loop element","src":"https:\/\/i0.wp.com\/www.jitendrazaa.com\/blog\/wp-content\/uploads\/2015\/11\/Sample-Salesforce-flow-using-loop-element.png?resize=350%2C200&ssl=1","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/www.jitendrazaa.com\/blog\/wp-content\/uploads\/2015\/11\/Sample-Salesforce-flow-using-loop-element.png?resize=350%2C200&ssl=1 1x, https:\/\/i0.wp.com\/www.jitendrazaa.com\/blog\/wp-content\/uploads\/2015\/11\/Sample-Salesforce-flow-using-loop-element.png?resize=525%2C300&ssl=1 1.5x"},"classes":[]},{"id":5070,"url":"https:\/\/www.jitendrazaa.com\/blog\/salesforce\/dependent-picklist-in-salesforce-flow-using-custom-metadata-type-video\/","url_meta":{"origin":5010,"position":1},"title":"Dependent picklist in Salesforce flow using Custom Metadata type &#8211; Video","author":"Jitendra","date":"December 7, 2015","format":false,"excerpt":"Salesforce flow is great alternative for Visualforce pages used by admin. I have written, multiple blog post on Salesforce flow already and in this post we will discuss how we can create dependent picklist in Flow. If you are already using flow, might know that creating dependent picklist is not\u2026","rel":"","context":"In &quot;Salesforce&quot;","block_context":{"text":"Salesforce","link":"https:\/\/www.jitendrazaa.com\/blog\/category\/salesforce\/"},"img":{"alt_text":"Salesforce flow - Dependent picklist output","src":"https:\/\/i0.wp.com\/www.jitendrazaa.com\/blog\/wp-content\/uploads\/2015\/12\/Salesforce-flow-Dependent-picklist-output.png?resize=350%2C200&ssl=1","width":350,"height":200},"classes":[]},{"id":4993,"url":"https:\/\/www.jitendrazaa.com\/blog\/salesforce\/creating-two-column-layout-in-flow\/","url_meta":{"origin":5010,"position":2},"title":"Creating two column layout in Flow","author":"Jitendra","date":"November 3, 2015","format":false,"excerpt":"Simple utility to convert One column to Two column layout in Salesforce Flow","rel":"","context":"In &quot;Salesforce&quot;","block_context":{"text":"Salesforce","link":"https:\/\/www.jitendrazaa.com\/blog\/category\/salesforce\/"},"img":{"alt_text":"Salesforce Two column layout in Flow","src":"https:\/\/i0.wp.com\/www.jitendrazaa.com\/blog\/wp-content\/uploads\/2015\/11\/Salesforce-Two-column-layout-in-Flow-1024x345.png?resize=350%2C200&ssl=1","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/www.jitendrazaa.com\/blog\/wp-content\/uploads\/2015\/11\/Salesforce-Two-column-layout-in-Flow-1024x345.png?resize=350%2C200&ssl=1 1x, https:\/\/i0.wp.com\/www.jitendrazaa.com\/blog\/wp-content\/uploads\/2015\/11\/Salesforce-Two-column-layout-in-Flow-1024x345.png?resize=525%2C300&ssl=1 1.5x"},"classes":[]},{"id":4970,"url":"https:\/\/www.jitendrazaa.com\/blog\/salesforce\/creating-lookup-field-in-flow\/","url_meta":{"origin":5010,"position":3},"title":"Creating Lookup field in Flow","author":"Jitendra","date":"October 30, 2015","format":false,"excerpt":"How to create alternative solution for Lookup fields in Salesforce flow","rel":"","context":"In &quot;Salesforce&quot;","block_context":{"text":"Salesforce","link":"https:\/\/www.jitendrazaa.com\/blog\/category\/salesforce\/"},"img":{"alt_text":"Lookup field - Screen 3","src":"https:\/\/i0.wp.com\/www.jitendrazaa.com\/blog\/wp-content\/uploads\/2015\/10\/Lookup-field-Screen-3.png?resize=350%2C200&ssl=1","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/www.jitendrazaa.com\/blog\/wp-content\/uploads\/2015\/10\/Lookup-field-Screen-3.png?resize=350%2C200&ssl=1 1x, https:\/\/i0.wp.com\/www.jitendrazaa.com\/blog\/wp-content\/uploads\/2015\/10\/Lookup-field-Screen-3.png?resize=525%2C300&ssl=1 1.5x"},"classes":[]},{"id":4632,"url":"https:\/\/www.jitendrazaa.com\/blog\/salesforce\/how-to-use-login-flow-in-salesforce\/","url_meta":{"origin":5010,"position":4},"title":"How to use Login Flow in Salesforce","author":"Jitendra","date":"July 7, 2015","format":false,"excerpt":"What is Login flow in Salesforce and how to solve common yet important problem using Salesforce declarative ability only.","rel":"","context":"In &quot;Salesforce&quot;","block_context":{"text":"Salesforce","link":"https:\/\/www.jitendrazaa.com\/blog\/category\/salesforce\/"},"img":{"alt_text":"Salesforce Login Flow Connection","src":"https:\/\/i0.wp.com\/www.jitendrazaa.com\/blog\/wp-content\/uploads\/2015\/07\/Salesforce-Login-Flow-Connection.png?resize=350%2C200&ssl=1","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/www.jitendrazaa.com\/blog\/wp-content\/uploads\/2015\/07\/Salesforce-Login-Flow-Connection.png?resize=350%2C200&ssl=1 1x, https:\/\/i0.wp.com\/www.jitendrazaa.com\/blog\/wp-content\/uploads\/2015\/07\/Salesforce-Login-Flow-Connection.png?resize=525%2C300&ssl=1 1.5x"},"classes":[]},{"id":6538,"url":"https:\/\/www.jitendrazaa.com\/blog\/salesforce\/send-salesforce-survey-without-writing-code\/","url_meta":{"origin":5010,"position":5},"title":"Send Salesforce Survey Without Code","author":"Jitendra","date":"October 21, 2018","format":false,"excerpt":"Use Flow & Process builder to send customer satisfaction survey on case close","rel":"","context":"In &quot;Salesforce&quot;","block_context":{"text":"Salesforce","link":"https:\/\/www.jitendrazaa.com\/blog\/category\/salesforce\/"},"img":{"alt_text":"Send Salesforce Survey using Flow and Process Builder","src":"https:\/\/i0.wp.com\/www.jitendrazaa.com\/blog\/wp-content\/uploads\/2018\/10\/Send-Salesforce-Survey-using-Flow-and-Process-Builder.png?fit=1120%2C540&ssl=1&resize=350%2C200","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/www.jitendrazaa.com\/blog\/wp-content\/uploads\/2018\/10\/Send-Salesforce-Survey-using-Flow-and-Process-Builder.png?fit=1120%2C540&ssl=1&resize=350%2C200 1x, https:\/\/i0.wp.com\/www.jitendrazaa.com\/blog\/wp-content\/uploads\/2018\/10\/Send-Salesforce-Survey-using-Flow-and-Process-Builder.png?fit=1120%2C540&ssl=1&resize=525%2C300 1.5x, https:\/\/i0.wp.com\/www.jitendrazaa.com\/blog\/wp-content\/uploads\/2018\/10\/Send-Salesforce-Survey-using-Flow-and-Process-Builder.png?fit=1120%2C540&ssl=1&resize=700%2C400 2x, https:\/\/i0.wp.com\/www.jitendrazaa.com\/blog\/wp-content\/uploads\/2018\/10\/Send-Salesforce-Survey-using-Flow-and-Process-Builder.png?fit=1120%2C540&ssl=1&resize=1050%2C600 3x"},"classes":[]}],"jetpack_likes_enabled":true,"_links":{"self":[{"href":"https:\/\/www.jitendrazaa.com\/blog\/wp-json\/wp\/v2\/posts\/5010","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.jitendrazaa.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.jitendrazaa.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.jitendrazaa.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.jitendrazaa.com\/blog\/wp-json\/wp\/v2\/comments?post=5010"}],"version-history":[{"count":11,"href":"https:\/\/www.jitendrazaa.com\/blog\/wp-json\/wp\/v2\/posts\/5010\/revisions"}],"predecessor-version":[{"id":5041,"href":"https:\/\/www.jitendrazaa.com\/blog\/wp-json\/wp\/v2\/posts\/5010\/revisions\/5041"}],"wp:attachment":[{"href":"https:\/\/www.jitendrazaa.com\/blog\/wp-json\/wp\/v2\/media?parent=5010"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.jitendrazaa.com\/blog\/wp-json\/wp\/v2\/categories?post=5010"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.jitendrazaa.com\/blog\/wp-json\/wp\/v2\/tags?post=5010"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}