On a form I have a custom multi-select field linked to the Contact Users. When an event is created, within the ETM, how do I get the id values of each selected contact user record, please? I need them to then add as additional users. (I have a working process for single user, and multiple user from individual fields, but logic is defying me for a multi-select field.)
Thanks
Best answer by Paul McCulloch
If you add customFields.multiSelectValues to the Fields entry and use ‘Record to Update’ to identify the ticket to modify then this expression should do what you want in the Addtional Affected Users field:
var msvs = outbound.self.customFieldsMap['EXTRA USERS'].multiSelectValues; var sparseObjects = []; for(var i=0; i<msvs.length; i++){ sparseObjects.push({id: msvs[i].systemLookupValueId}); } sparseObjects;
So, you log tickets via assyst’s web ui. 0 or more contact users are selected in some custom field. Yo then have some channel that processes these tickets and converts the custom field selcted users to ‘proper’ additional affected users?
The ticket is logged via assystNet, but yes, that is correct. I need to extract the user ids into an array (eg [1, 2, 3]) so that that can be then fed into a datamapper that then adds them to the ticket as additional users.
After querying for the event, I have all the entries in the multiSelectValues block for the custom field, but it’s extracting each id from that block that is needed.
If you add customFields.multiSelectValues to the Fields entry and use ‘Record to Update’ to identify the ticket to modify then this expression should do what you want in the Addtional Affected Users field:
var msvs = outbound.self.customFieldsMap['EXTRA USERS'].multiSelectValues; var sparseObjects = []; for(var i=0; i<msvs.length; i++){ sparseObjects.push({id: msvs[i].systemLookupValueId}); } sparseObjects;