Re: MK Check Boxes to SFDC Multi Select

Carrie_Lawson
Level 4

MK Check Boxes to SFDC Multi Select

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

Tags (1)
6 REPLIES 6
SanfordWhiteman
Level 10 - Community Moderator

Re: MK Check Boxes to SFDC Multi Select

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);

  });

});

Carrie_Lawson
Level 4

Re: MK Check Boxes to SFDC Multi Select

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?

SanfordWhiteman
Level 10 - Community Moderator

Re: MK Check Boxes to SFDC Multi Select

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.

Carrie_Lawson
Level 4

Re: MK Check Boxes to SFDC Multi Select

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?

SanfordWhiteman
Level 10 - Community Moderator

Re: MK Check Boxes to SFDC Multi Select

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.

SanfordWhiteman
Level 10 - Community Moderator

Re: MK Check Boxes to SFDC Multi Select

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.