web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Customer experience | Sales, Customer Insights,...
Suggested Answer

Multi-select form field submission behavior

(0) ShareShare
ReportReport
Posted on by 15

Hello,

I need to include a multi-select field on Marketing form (Landing page form type) as a hidden pre-filled check-box, however, I need to achieve that if the Contact is already existing in the CRM database with a different value for this multi-select field, that value doesn't get over-written, but the pre-filled value get's added to the multi-select field on the Contact record.

So if on a Contact record I have multi-select field that specifies my contact type, which can be Type A, Type B or both, and I have a Contact which is classified within the system as Type A, but that contact submits a form for Type B Contact, after that form submission, the Contact is classified as Type A and Type B Contact, so the Type B hidden pre-filled value gets added to the contact type field and does not over-write the previously chosen Type A value.

How can one achieve that?

Thank you very much for your time and answer in advance.

All the best,

Marianna

I have the same question (0)
  • Suggested answer
    RodRodriguez Profile Picture
    on at

    This is something you could do with a JavaScript.

    To get you started, this is a JavaScript I have that will hide or show a separate field based on the value in a MultiOptionSet field.  Should be easy enough to modify to your needs by putting in some logic:

    function multiOptionSetHideOrShowField(executionContext)

    {

    var formContext = executionContext.getFormContext();

           var fieldObj = formContext.getControl("fax")

    var multiOptionSetFieldValues = formContext.getAttribute('new_multioptionset').getValue();

     if (multiOptionSetFieldValues == null)

     {

       fieldObj.setVisible(false);

     }

     else

     {

       if(multiOptionSetFieldValues.includes(2)) //When user will select multiple options and 'other'(value 2) is one of them

       {

         fieldObj.setVisible(true); //Specify true to show the field; false to hide the field.            

       }

       else

       {

         fieldObj.setVisible(false);

       }

     }

    }

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Congratulations to our 2025 Community Spotlights

Thanks to all of our 2025 Community Spotlight stars!

Leaderboard > Customer experience | Sales, Customer Insights, CRM

#1
Tom_Gioielli Profile Picture

Tom_Gioielli 108 Super User 2025 Season 2

#2
TAHER_El_Mehdi Profile Picture

TAHER_El_Mehdi 30

#3
Satyam Prakash Profile Picture

Satyam Prakash 24

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans