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
Jeff Rozner 39Jeff Rozner 39 

I'm trying to check or uncheck Checkbox field, if another Field that is a Picklist has a value that matches a picklist value

Kind of a noob, sorry fo not knowing the right answer here...does this seem to be on the right track?

IF(ISPICKVAL(Status, "Subscribed"),
           Marketing_Cloud_Subscriber__c.Status__c = False;
           else if (ISPICKVAL(Status, "Unsubscribed"),
           Marketing_Cloud_Subscriber__c.Status__c = True;
venkat-Dvenkat-D
You can create formula field of type Checkbox and use IF(ISPICKVAL(Status, "Subscribed"),True,False) in the formula field.
Jeff Rozner 39Jeff Rozner 39
Venkat-D
there are 3 possible picklist values: subscribed, unsubscribed , and no preference. i want to set the value of the status checkbox to "Checked" (or True, I guess) if the picklist value equals 'unsubscribed" ,to set the value of the status checkbox to "Unchecked" (or False, I guess) if the picklist value equals "subscribed"
venkat-Dvenkat-D
A checkbox can have only two values i.e. True or False. I dont know how you can capture no preference with checkbox
venkat-Dvenkat-D
Can you tell us your requirement so that we can see if checkbox fits your requirement or not?
Jeff Rozner 39Jeff Rozner 39
Correct, I only want to capture subscribed and make it equal to unchecked; or unsurscribed and make it equal to checked. I want to ignore no preference
RbnRbn
Hi Jeff,

Please try out the below formula:

If( text( Testing_Checkbox__c ) =='subscribed'   ||   text(Testing_Checkbox__c) =='preference',false,true )

Here Testing_Checkbox__c is the  Picklist field holding 3 values ( subscribed, unsubscribed , no preference.)

NOTE : : Since you got 3 values, assuming that one value has to be checked and the remaining two will be unchecked.

In this , As of now i am only Checking the Unscribed Field to Checked and for other two values its unchecked.

You can try tweaking this based on your requirement or let us know if my any changes in the requirement.

Regrds,
Rabi
venkat-Dvenkat-D
IF(ISPICKVAL(Status, "Subscribed"),False,True) - try this. I just swapped true and false as per your statement.