SOLVED

Marketo Form - Uncheck other checkboxes when 'Unsubscribe from all' box is checked

Go to solution
Jessica_Hendrix
Level 1

Re: Marketo Form - Uncheck other checkboxes when 'Unsubscribe from all' box is checked

Ok makes sense. I didn't know there was a checkbox set field! That opens up a whole new world of possibilities. 

 

So we're trying to set up our preference center now that we have a bigger team and can put out different types of content on a more regular basis. Our salesforce admin has created a field for each option as a boolean field and all of our email sends will have the corresponding smart lists to segment the data base. 

 

Would it be best to update the fields to a checkbox set field instead, that way we can get the functionality of clearing all preferences if the unsubscribe all box is ticked? Or is there a better way to set up our preference center to manage the existing multiple fields and smart lists?

 

 

SanfordWhiteman
Level 10 - Community Moderator

Re: Marketo Form - Uncheck other checkboxes when 'Unsubscribe from all' box is checked


Our salesforce admin has created a field for each option as a boolean field and all of our email sends will have the corresponding smart lists to segment the data base. 


A reasonable way to set up the database schema. But it's more manageable on the form side to use a Checkboxes set with a form-only field ("form-only" means "exists in your database, but only so it can be used in Form Editor, not in Smart Lists").

 

Then you use the JS I linked to above to translate the form-only field into each of the constituent Booleans.

Jessica_Hendrix
Level 1

Re: Marketo Form - Uncheck other checkboxes when 'Unsubscribe from all' box is checked

Ok @SanfordWhiteman last question!!


I've got the fields in a checkbox set and mapping correctly AND the unselect all function is working correctly!

 

We have the unselect all field as the unsubscribe from all options (which is why we wanted it to unselect all the other fields in the form) however, with the -* to unselect all in the stored value, we can't mark the boolean field unsubscribe all to true. Is there a way the field can do both actions when selected? The first being to clear the other values and the second to map the the boolean field as true?

 

I suppose the workaround would be having a smart campaign that says when the form is completed and all other fields are marked false - set the unsubscribe all to true?

SanfordWhiteman
Level 10 - Community Moderator

Re: Marketo Form - Uncheck other checkboxes when 'Unsubscribe from all' box is checked

We have the unselect all field as the unsubscribe from all options (which is why we wanted it to unselect all the other fields in the form) however, with the -* to unselect all in the stored value, we can't mark the boolean field unsubscribe all to true. Is there a way the field can do both actions when selected?

I updated the code (both components) to treat any string that follows -*- or *- (note the additional hyphen) as the Boolean field.

 

So if the field value is -*-MyOtherField then MyOtherField will be the Boolean set to yes or no.