MK Check Boxes to SFDC Multi Select | Community
Skip to main content
Carrie_Lawson
Level 4
October 18, 2016
Question

MK Check Boxes to SFDC Multi Select

  • October 18, 2016
  • 2 replies
  • 2705 views

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

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.

2 replies

SanfordWhiteman
Level 10
October 18, 2016

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
October 20, 2016

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
October 20, 2016

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
October 18, 2016

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
October 18, 2016

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.