 Hello friends. I'm Sanjay Gupta. I welcome you on Sanjay Gupta Tech School. So in this video, I'm going to demonstrate how you can set current value of pick list in flow without duplicates. So let me explain the scenario first. So let's say this is the opportunity record and I want to query this opportunity record in the flow and in flow, whatever is the current value of this stays pick list. I want to set it as default in the flow, right? So I have created this flow. So I'm going to explain this step by step how you can achieve this. So first of all, I'm going to query the opportunity. So here this is the condition ID should be equals to record ID. So this flow will be executed for a particular opportunity. So that record ID will be available in record ID variable. Then I'm going to query opportunity stage, name and close date. So these are the variables which are created in flow. Op stage, op name and op date, right? And if I go to this opportunity details, so here I have created three components. First is name, second stage and third is date. So if I click on name, so here you can see default value is opportunity name. So whatever opportunity name will be populated on the record that will be available here. Then for date, I used opportunity date as default value. So that will be automatically populated here. Now coming on to the stage pick list component. So here I have used two things, two choices, stage name and current stage. So let me explain these two things, what is stage name and what is current stage. So this stage name is a pick pick list choice set. So whenever we want to show the pick list values in flow, we use this pick list choice set. So this is the API name, objective opportunity and data type is pick list and field is stage name. So whatever values in this stage name field will be available that will be stored inside this variable that is stage underscore name. And I have used it in this component. So that stage name will be displaying all the values that are available in stage name pick list of opportunity. Now to show current value as well. So I created current stage choice. So current stage choice is here. So you need to create a choice variable in which you need to use label as opportunity stage that we query and its value will be opportunity state. So this is the current value that we acquired from the record. So that is the choice. So I have used both while creating this stage pick list component. So these are the, these are all choices and this is the current choice or current stage. And here you can see default value is current stage. So whatever current pick list value will be on that record that will be the default value. So I'm clicking on done and I'm saving this popping this record ID and I am debugging this. So here you will see duplicate values will be available. So after this, I will tell you how you can remove that duplicate. So if I go here, so you can see it is showing a stage as negotiation and review. So this, this is correct as of now, but if we see it carefully, so this value is available twice. So from all the pick list values, one option is available and second one is to current value. So now we need to remove one value from this stage pick list because we cannot use multiple options here. So to do that, you need to remove this stage name so you don't need to use pick list choice set instead you need to use record choice set. So I'm going to click on this. So I created stage underscore pick list underscore choices as the name for this record choice set object I selected pick list values and value info. Then conditions are entity practice ID equals opportunity dot stage name. So you need to put the pick list API on which record it is available. Sorry, on which object it is available. So object then dot then pick list API and the value which you want to ignore. So for that value does not equal opportunity stage. So this is the current value that we want to skip. So basically it will query all the pick list of stays and it will ignore this current stage value and it will show values in ascending order and choice label will be label data type text and value and whenever we select a particular value that will be stored in selected states variable. So this selected state selected states variable can be used further so that we can do any other operation. So this way you need to create this record choice set so that you can remove the duplicates. Now, again, I'm opening the screen. And here in this pick list component, I need to remove this. And I need to add this record choice set which is stage pick list choices. And I'm clicking on that. Clicking on save. And now if I click on debug. If I put that API name and click on run. So here you can see this negotiation and review is coming once and it is not repeating. So this way I have removed the duplicate entry of that stays pick list value. Now, if you want to use this further. So for that, you need to use this decision. This default selected if you have selected the current value that was available already available on the record. So the selected states variable will be null. Right. So if it is null, it means you have not changed a pick list value you are using the current value as it is. So in that case, if default is selected, then you need to assign that opportunity stage into selected states. So this week, where it from the record, and this is this variable is available in the flow. So the default value will be stored in this variable, and then we can use it. So I am using another screen so that I can show the value of this selected stage. So if you have selected a particular stage other than the value that was populated on the record, so that will be the default outcome so that will be displayed automatically. So here if I leave it as it is, so here you can see it is the value. And if I select any other value, so that will be displayed here. So with this decision and assignment. So finally the selected, finally the selected stage variable is having the selected value, whether it is default or it is the new value. So you can use this variable further if you have any other steps in this flow. So this way I hope you understood how we can use this current value as the default value in flow and along with that, how can we use other pick list values as well. And how we can remove the duplicates. So this is all about this. So if you want to watch more flow related videos so you can go to description of this video where you will find various links related to Salesforce videos that along with that flow builder videos are also available so you can follow them. I hope you understood whatever explained in this video. Thank you for watching this video.