2

So there are really 2 components to this question:

  • Why can't I make a drop down field NOT 'required' in visual flow? and
  • Why does each record in my sObject collection variable contain the previous record's dropdown choice as its default value?

More detailed explanation below: I have a dropdown list in a visual flow, and it defaults to being a 'Required' choice, with no option for the user to leave it as an empty value.enter image description here

I gather from Salesforce documentation that I should be able to make this field NOT required, but that option simply isn't visible. The field is not set as 'required' at the object level, or the page layout level.

The other part of this is that the flow iterates over a set of records in an sObject collection variable, using a loop. Each new record in the loop gets prepopulated with the dropdown value selected in the previous record. ie - if the previous answer was 'Yes', then the next record defaults to 'Yes', even if I set a default value for the field.

I have also tried using an assignment variable to set the dropdown value to a specific value, after each loop is performed, and before going to the screen again, but no success with that.

0

This is by design when you Add a Dynamic Choice to a Flow using a multi-select choice field.

When a multi-select choice field uses a dynamic choice, only values from the last record that the user selects are stored in the flow variables. If multiple multi-select choice fields on one screen use the same dynamic choice, the first multi-select choice field on the screen determines the flow variable assignments.

I'll add that sObject variables when used in loops are intended more for use to iterate over existing lists of data, not for situations where a user is making choices and adding data to a list.

  • In this case the choice isn't 'Dynamic' though. Its just a standard single-choice picklist. The real objective of this flow is to have the user iterate over over a list of child/detail records related to a parent record, and modify the value of the picklist field in each record. – Greg J Aug 18 '15 at 1:08
  • 1
    My bad, I misread when looking for an answer. What you want is for the flow to stop during each iteration rather than assuming the initial choice applies to all, correct? You may need to embed the flow in a VF page to achieve this behavior. See Render Flows With Visualforce for how to customize flow with VF. You may need to add actionSupport or some other method. – crmprogdev Aug 19 '15 at 20:33
  • Thanks @crmprogdev, I did end up having to embed a flow within a flow - essentially forcing the 'inner' flow to go back to the beginning of each iteration - it still didn't clear the previous picklist value, but it does clear text field values that way. In hindsight it probably would have been easier to build a VF page to manage it all. – Greg J Aug 20 '15 at 7:45
  • That's what I concluded and is why I was slow to respond with more. Was trying to see if you could do it with the Flow Builder and couldn't find a way for you to do that. Originally all Flows were built by creating "flow interviews" embedded in VF pages. Flow builder has it's limitations & this is one of them. – crmprogdev Aug 20 '15 at 13:19

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.