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
Nevin O'Regan 3Nevin O'Regan 3 

I want a picklist field to move to the next value in a flow

Hi guys,

I have a custom object called Year__c whis has a picklist field called Period__c which has values 1 - 10. I have built a screen flow which includes the creation of a Year__c object.
Each time a new Year__c record is created I want the Period__c to automatically update with the next picklist value.
How can I do this in a flow?
ShirishaShirisha (Salesforce Developers) 
Hi Nevin,

I don't think this can be achieved by the flow as you need to update the picklist whenever the records is created.

But,can you please try to create the number field and create the workflow rule to update the picklist value by one and put the logic that it should not be more than 10 whenever you create the record.

Please feel free to reach out to the accelerator team who can give you the idea on how you can implement according to your business requirement,if you have premier success plan.

Please find the details on how to request for an accelerator:https://help.salesforce.com/articleView?id=000337601&type=1&mode=1

Otherwise,I would request you to reach out to your account Executive If you wish to upgrade to Premier Support please contact your Account Executive.

Kindly let me know if it helps you and close your query by marking it as solved so that it can help others in the future.

Warm Regards,
Shirisha Pathuri
 
Nevin O'Regan 3Nevin O'Regan 3
Hi Shirisha

Thanks for your reply. I will give this a try but I'm not sure that this will work. For example if I have 4 Year objects related to an Opportunity the Period__c field will be sequencial e.g. first Year the Period__c = 1, second Year the Period__c = 2, third Year the Period__c = 3 etc. I want to be able to build this in a way that everytime I create a new Year record it will select the next Period__c value based on the Period__c in the most recent related Year__c  record.
Piyush Gautam 6Piyush Gautam 6
Hi Nevin O'Regan 3,

Before creating the Year Object record, fetch the newest created Year Object Record (or all the related Year Records and sort them by picklist value) of the respective opportunity. Update the new Year record's picklist value based on the fetched record.
Nevin O'Regan 3Nevin O'Regan 3
Thanks Piyush, how do I update the picklist value to the next value though? Do I use a formula to update to the next value? 
Piyush Gautam 6Piyush Gautam 6
Hi Nevin O'Regan 3,

Using formula( equal to the old record picklist value which is having the greatest value + 1) and the assigning it to the new record will be better for such scenario.
Nevin O'Regan 3Nevin O'Regan 3
Hi Piyush,

So something like TEXT(Picklist__c +1)?