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
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);
}
}
}
André Arnaud de Cal...
291,969
Super User 2025 Season 1
Martin Dráb
230,842
Most Valuable Professional
nmaenpaa
101,156