var List = formContext.getAttribute("c30_list").getValue();
var dListParsed = Array.isArray(List) ? List : [];
var To = formContext.getAttribute("to").getValue();
var oContacts = Array.isArray(To) ? To : [];
//code to retrieve and populate dContacts Array
// do the merge like the other one
var mergedContacts = [...oContacts];
dContacts.forEach(function (contact) {
if (!mergedContacts.find(c => c.id === contact.id)) {
mergedContacts.push(contact);
}
});
// Set the final merged TO value
formContext.getAttribute("to").setValue(mergedContacts);
André Arnaud de Cal...
294,261
Super User 2025 Season 1
Martin Dráb
233,017
Most Valuable Professional
nmaenpaa
101,158
Moderator