How to remove blocked datatypes and also allow the attachment data type in the Multi row variable set
Servicenow has restricted a few data types like Attachment, Container start, etc in the multi-row variable set. If you really want to use those data types in your multi-row variable set please modify the below business rule based on your condition and then change the data type of the variable.
OOB Business rule Name: Restrict types for table variable set
BR Written on Table: Variable[item_option_new]
BR Scope: Global
The exceptional script is needed if you want the Attachment type variable should work properly.
Reason: If the user will add multiple rows with attachments and submit the form the attachments will not reflect in the new reocrd. As this will store in the attached table with different table names and also stores the table_sys_id field value as the MRVS sys_id.
Solution: Create a script include(New Class) in the global scope and create the below function inside the script include.
updateAttachmentData: function(recordID) { /*Update the table name and table sys_id for the attachment MRVS*/ var attachment = new GlideRecord('sys_attachment'); attachment.addQuery('table_sys_id', ''); // MRVS Sys ID attachment.query(); while (attachment.next()) { attachment.table_sys_id = recordID.toString();// Newly created record sys_id attachment.table_name = ''; attachment.update(); }
}
https://www.servicenow.com/community/itsm-articles/how-to-remove-blocked-datatypes-and-also-allow-the-attachment/ta-p/2306729