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
bharath kumar 52bharath kumar 52 

How can i compare a picklist's values in a formula in process builder?

Hi,

I am trying to build a formula in process builder where i need to check if the country's picklist value is either "United States" or "US" or "United States of America" but the thing is only United States is in the picklist(which is ok). But when i try to use the below formula in process builder i get a error message as shown below . Can someone help me out ?
Formula result is data type (Boolean), incompatible with expected data type (Text)




User-added image
ISPICKVAL([Deal_Registration__c].Country__c,"United States")||
ISPICKVAL([Deal_Registration__c].Country__c,"United States of America")||
ISPICKVAL([Deal_Registration__c].Country__c,"US")

 
Maharajan CMaharajan C
HI Bharath,

Use the below formula:
 
IF( ISPICKVAL([Deal_Registration__c].Country__c , 'United States' ), 'United States',
IF( ISPICKVAL([Deal_Registration__c].Country__c , 'United States of America' ), 'United States of America',
IF( ISPICKVAL([Deal_Registration__c].Country__c , 'US' ), 'US',
NULL)))

And Use the Operator as Equals dont use contains. Refer the below screenshot:

User-added image


Thanks,
Maharajan.C
gtjgfhg gretfrdgtjgfhg gretfrd
Yes you can compare this stuff with picklists values by taking this code you can see here (https://bestgamesapk.com/youtube-mod-apk/) for more you can directly take this code from there too.
Suraj Tripathi 47Suraj Tripathi 47
Hi bharath kumar,

You can use the below formula to solve your query also use the Equal operator for comparision

IF( ISPICKVAL([Deal_Registration__c].Country__c , 'United States' ), 'United States',
IF( ISPICKVAL([Deal_Registration__c].Country__c , 'United States of America' ), 'United States of America',
IF( ISPICKVAL([Deal_Registration__c].Country__c , 'US' ), 'US',
NULL)))

I hope you find the above solution helpful. If it does, please mark it as Best Answer to help others too

Thanks and Regards,
Suraj Tripathi
Toni linkaToni linka
I have tried to get ans over youtube (https://www.youtube.com/) but havent got any thing.
IF( ISPICKVAL([Deal_Registration__c].Country__c , 'United States' ), 'United States', IF( ISPICKVAL([Deal_Registration__c].Country__c , 'United States of America' ), 'United States of America', IF( ISPICKVAL([Deal_Registration__c].Country__c , 'US' ), 'US', NULL)))
it really works for me. Thanks mate.