Is there a way to combine all check box fields into one so a multi-select option will be populated in SFDC?
Ie. subscription center is check box options in MK and in SFDC they were set up as Multi Select options. Need to create a 4:1 options
Sure, but of course you'll also need the SFDC field synced over.
Then add the SFDC multi-select as a hidden field on submit:
MktoForms2.whenReady(function(form) {
var consolidateCheckboxes = [{
sourceFields: ["booleanFieldOne", "booleanFieldTwo", "booleanFieldThree"],
targetField: "multiSelectFieldOne"
}];
form.onSubmit(function(form) {
var currentValues = form.getValues(),
hiddenFields = {};
consolidateCheckboxes.forEach(function(map) {
var sourceValues = [];
map.sourceFields.forEach(function(field) {
currentValues[field] == 'yes' && sourceValues.push(field);
});
hiddenFields[map.targetField] = sourceValues.join(';');
});
form.addHiddenFields(hiddenFields);
});
});
Thanks for the info Sanford. Our subscription center is already dynamic using a hidden field. If they have access to our customer portal they are sent there to manage their communication preferences. If they do not have access they see a form with 5 options, which includes Unsubscribe All.
Do you foresee any issues with still being able to use the page dynamically they way we currently do?
If some people are redirected away from the form (to your customer portal) that is not a problem. The form behaviors will work for anyone who sees the problem.
is the only way to accomplish this to do this on the form? can this not be completed using a smart campaign after the form is filled out?
You could try to assemble all the possible values using using flow steps. I would never do it this way as the room for error (not to mention unmaintainabilty) is huge.
Well, I should say using Change Data Value flow steps it's never something I would do.
Using a FlowBoost script it would be fine, since you could use much of the same code from the form.