function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
dlampdlamp 

Reorder DropDown choices

Several users have latched on to VWF within our organization, and things were going swimmingly well until the came to me opining that there was no " -- Select One --" as the initial dropdown choice option.  No problem, I thought, just add another choice and put it at the top.

 

Bummer.  Doesn't look like one can do that without reassigning all of the subsequent choices.  Perhaps just annoying if there are only a handful of choice.  But downright maddening if it's several dozen dropdowns with several of them having >25 options.

 

Have I just missed something obvious, or is there really no way to reorder choices without reassigning them? 

markross__cmarkross__c

Also need to know this! I created a 150+ entry picklist until I realized that, as soon as someone requested an entry that would alphabetically go in the middle, I would have to remove every entry that followed it and re-add them. Needless to say, I felt sheepish.

RajaramRajaram

Yes, to be able to re-order the choices in the designer is something we are aware and is something we will work on in subscequent releases.

If you have a lot of choices, think about moving them to a table and use Dynamic Choices where you can now sort.

 

However if you want to use static choices, all is not lost! Flows are exposed in the MD API, so you can easily do this "behind the scenes".

Here is the xml of a simple flow with a screen choice field with 3 choices:

<?xml version="1.0" encoding="UTF-8"?>
<Flow xmlns="http://soap.sforce.com/2006/04/metadata">
<choices>
<name>Choice_1</name>
<choiceText>Choice 1</choiceText>
<dataType>String</dataType>
</choices>
<choices>
<name>Choice_2</name>
<choiceText>Choice 2</choiceText>
<dataType>String</dataType>
</choices>
<choices>
<name>Choice_3</name>
<choiceText>Choice 3</choiceText>
<dataType>String</dataType>
</choices>
<choices>
<label>Re Order Choices</label>
<screens>
<name>Show_Choices</name>
<label>Show Choices</label>
<locationX>258</locationX>
<locationY>82</locationY>
<fields>
<name>Your_Choices</name>
<choiceReferences>Choice_1</choiceReferences>
<choiceReferences>Choice_2</choiceReferences>
<choiceReferences>Choice_3</choiceReferences>
<dataType>String</dataType>
<fieldText>Your Choices</fieldText>
<fieldType>RadioButtons</fieldType>
<isRequired>false</isRequired>
</fields>
</screens>
<startElementReference>Show_Choices</startElementReference>
</Flow>

 

 

As you can see the Screen choice ordering is Choice_1, Choice_2, Choice_3

 

If you want to reorder them, then all you need to do is something like the following (just the screen choice field section)

 

<fields>
<name>Your_Choices</name>
<choiceReferences>Choice_3</choiceReferences>
<choiceReferences>Choice_2</choiceReferences>
<choiceReferences>Choice_1</choiceReferences>
<dataType>String</dataType>
<fieldText>Your Choices</fieldText>
<fieldType>RadioButtons</fieldType>
<isRequired>false</isRequired>
</fields>

 

This will reorder them to Choice_3, Choice_2, Choice_1.

 

 

If you are wondering, how will I get a handle on the flows, just use the Force.com IDE and you can download the xml file and you can deploy it from there. You can also use the Salesforce ant migration tool kit if you like.

 

When  you deploy this flow, your existing flow will be overwritten by this!

 

 

Hope this helps...