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
Shiva VenuShiva Venu 

Concatenate Pick Field values

I want to concatenate 5 picklist fields values in a new custom field on the Lead object. All are single pick text fields. The new field can be a formula (read-only) or text field.

Output format: Picklist1_Picklist2_Picklist3_Picklist4_Picklist5
condition :
1. underscore should skip if any value is null or blank.
2. For picklist 1 it should only add selected values (Eg: Pick values: a, b, c, d, e, f: it should only add to the formula when a or b or c is selected else it should be blank)

Can someone help with the formula or workflow for this requirement?
Best Answer chosen by Shiva Venu
sowmya Inturi 9sowmya Inturi 9
Hi Shiva,
You can use below formula field as reference and build your own formula field. I just tried with account standard picklist fields.
And for your second requirement just took the 'Banking' and 'Chemicals' picklist values of Industry picklist field. It will only add those two values to the formula.


IF(AND( NOT(ISPICKVAL(Type, '')),NOT(ISPICKVAL(Rating, ''))) ,TEXT(Rating)+'_',TEXT(Rating))+ IF(  AND(NOT(ISPICKVAL(Industry, '')),NOT(ISPICKVAL(Type, ''))) ,TEXT(Type)+'_' ,TEXT(Type))+
IF(OR(ISPICKVAL(Industry, 'Banking'),ISPICKVAL(Industry,'Chemicals')),
IF(AND( NOT(ISPICKVAL(Industry, '')),NOT(ISPICKVAL(Rating, ''))) ,'_'+TEXT(Industry),TEXT(Industry)),'')


Thanks,
Sowmya.

All Answers

sowmya Inturi 9sowmya Inturi 9
Hi Shiva,
You can use below formula field as reference and build your own formula field. I just tried with account standard picklist fields.
And for your second requirement just took the 'Banking' and 'Chemicals' picklist values of Industry picklist field. It will only add those two values to the formula.


IF(AND( NOT(ISPICKVAL(Type, '')),NOT(ISPICKVAL(Rating, ''))) ,TEXT(Rating)+'_',TEXT(Rating))+ IF(  AND(NOT(ISPICKVAL(Industry, '')),NOT(ISPICKVAL(Type, ''))) ,TEXT(Type)+'_' ,TEXT(Type))+
IF(OR(ISPICKVAL(Industry, 'Banking'),ISPICKVAL(Industry,'Chemicals')),
IF(AND( NOT(ISPICKVAL(Industry, '')),NOT(ISPICKVAL(Rating, ''))) ,'_'+TEXT(Industry),TEXT(Industry)),'')


Thanks,
Sowmya.
This was selected as the best answer
Shiva VenuShiva Venu
Thanks, Sowmya!! this helped.