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
George Galaios 22George Galaios 22 

Keep Picklist values in a flow when redirecting

I have a flow to create a lead record. I have several fields, some of them are picklists where i have 2 choices, one choice for --None--, and another choice with the values of this field. For example, like the picture below:


User-added imageIn my flow, the steps are the following:
Screen -> New Lead (provides all the necessary fields to the user in order to fill them in)
Assignment -> Assign all the values inserted by the user to a Lead Record
Call apex function where this lead record is given as input and perform a custom validation
In case of validation error, return back to the initial screen but the values need to be as filled in by the user.

User-added imageProblem: When navigating back to the initial screen, all the values of picklist fields are returned to the --none-- choice, however i want to keep the previous one selected by the user.
I don't want to have all the choices separately, since they may change often, so i want to get all the picklist values dynamically.
I want this flow to be able to be functional on partner communities.
How could i resolve this issue? Any suggestions ?
Best Answer chosen by George Galaios 22
ShirishaShirisha (Salesforce Developers) 
Hi Goerge,

Greetings!

This is working as expected as whenever we go back to the previous screen the values which we have given will be lost.You can avoid this by implementing the workaround as below:

Instead of going to the screen where you need to provide inputs,you can save all the given values in the variable and assign them to the field in one screen and navigate to that screen if the validation rule fails.

Also,we have 3 workarounds provided in the below documentation provided in the salesforce documentation for this scenario but as per your requirement they might not be helpful.But still,I would suggest you to have a look at them to proceed.

https://help.salesforce.com/articleView?id=000350820&language=en_US&mode=1&type=1

Kindly mark it as best answer if it helps so that it can help others in the future.

Warm Regards,
Shirisha Pathuri