+ Start a Discussion
Karleen MendozaKarleen Mendoza 

Decision Element and Picklist Choice Field in Flow

I want to create a decision element that says:
If picklist choice is "Inquiry Only" and Checkbox = true, go to error screen

However, when I am using a picklist choice field, how can I get the stored value to read in the decision element?
User-added image
User-added image
Gaurav HandooGaurav Handoo
Hi Karleen

Post your Screen element, you need to add an assignment element to move the value selected from Screen onto a variable. You can use that variable in decision element to define the path of rest of your flow.

Hope this helps!! Let know if it doesn't.

Cheers!!

Gaurav
NagendraNagendra (Salesforce Developers) 
Hi Karleen,

Create a text variable with the desired value as shown in the snapshot below: 
User-added image
Thanks,
Nagendra
Karleen MendozaKarleen Mendoza

Hi Gaurav and Nagendra,
 

Thanks for your reply. I am still not understanding how I get the picklist value into the constant. Below is my screen element:

The choice is for the type field. This is set up as the picklist choice above.
User-added image

Do I just create an assignment that pulls the value into the constant, then make decision element?

Gaurav HandooGaurav Handoo
Hi Karleen

This was a sample flow that I created for tagging pricebook with opportunity:
  1. Fetch pricebooks (in a picklist)
  2. Assign them to a variable
  3. Update Opportunity with the value

Complete Flow

Pick-list and assignment screenshots are below:

Screenshot of Screen with a picklist field
Screenshot of assignment to a variable

Hope this helps.

Cheers!!

Gaurav
Karleen MendozaKarleen Mendoza
Hi Gaurav,

Thanks for all your help (with the other questions I posted as well)! It worked!

 
Gaurav HandooGaurav Handoo
If you could mark my reply as answer (on the other question), that would help.
Orlando BricenoOrlando Briceno
Hi Gurav, Karleen

I am not getting why the captured selection of the picklist in the screen needs to be saved in a variable, am I missing the point? I tought that what Karleen was missing was the third item of the decision element (Resource, Operator, Value).

As per what I understand, I am facing the same problem, I am able to capture a couple of picklists in a screen

User-added image

And I am able to use the selected values in flow decision element as a resource in comparisson/criteria

User-added image

The part I haven't figured out is how to get the Value part for the comparisson/critera to use an option from the picklists (Equipment_Type_Options, Equipment_Sub_Type_Options)

User-added image



Karleen is this something similar to what you were facing? if so, how you proceeded? 

Gurav is it really needed to create a variable and assign the picklist option text to be able to use it in the decision?

Thank you! cheers
Gaurav HandooGaurav Handoo
Hi Orlando

I agree with you, that this indeed sound stupid to have to be done this way. However, in my experience of using Visual flows this is the only way I've been able to successfully use the screen input elements for further elements.

As for using "Picklist Value" into you criteria Value, you would need individual choice selections to be created manually. In case you are creating a dynamic picklist or fetching picklist choice from an Object, Visual flow will not fetch the values for being used inside a decision element.

Attaching a sample screenshot for your reference.
User-added image

If you observe here, single Choice value created is showing up as a text variable, while the picklist choices are being shown as is.

One more reason for using assignment element before using, picklist and/or other inputs from screen, for any other operational element.

Hope this helps.

Cheers!!

Gaurav
Orlando BricenoOrlando Briceno
Hi Gaurav, 

thank you for your swift reply!

Before getting your reply I went ahead and trying both to move forward and apply what I interepted from what you mentioned in your previous posts to Karleen and created some variables to hold what I wanted to compare in the Value part of the decision element, like this:

User-added image

Would you advice agains this? I get that using a choice element would be correct-er hehe, but wonder if one has an advantage over the other.

Gaurav a closely related question, I added some new picklist fields to my Opportunity object, and for some reason they are not appearing available to create a new Picklist Choice in my flow.

User-added image


User-added image

Have you seen this before? Is there something I'm missing?

Thank you so much Gaurav for your insight, cheers,

Orlando