Join the #BuildWithBuildAgent Challenge! Get recognized, earn exclusive swag, and inspire the ServiceNow Community with what you can build using Build Agent.  Join the Challenge.

Add attachment to MultiRow Variable Set

Community Alums
Not applicable

Hi,

I have a requirement to add attachment to multi-row variable set. When I was searching, I found this link. I am unable to completely edit the script as required. I am not sure about the table name. Kindly help.

 

https://www.servicenow.com/community/itsm-articles/how-to-remove-blocked-datatypes-and-also-allow-th...

 

multirowvariableset.png

 

 

 

var Restrict_types_for_table_variable_set = Class.create();
Restrict_types_for_table_variable_set.prototype = Object.extendsObject(AbstractAjaxProcessor, {

	updateAttachmentData: function(recordID) {
	var attachment = new GlideRecord('sys_attachment');
        attachment.addQuery('table_sys_id', '430feb9a87e09254cc58c846cebb35d2'); //  MRVS Sys ID
        attachment.query();
        while (attachment.next()) {
            attachment.table_sys_id = recordID.toString();// Newly created record sys_id
            attachment.table_name = '<Type your table name>';
            attachment.update();
        }
    },

    type: 'Restrict_types_for_table_variable_set'
});

 

 

 

 

Regards

Suman P.

 

 

6 REPLIES 6

Juhi Poddar
Kilo Patron
Kilo Patron

Hello @Community Alums 

 

If you want to attach the attachment to MRVS the table name should be "item_option_new_set"(variable set table).

If the attachment is needed in RITM then the table should be 'sc_req_item'.

 

"If you found my answer helpful, please give it a like and mark it as the accepted solution. It helps others find the solution more easily and supports the community!"

Thank You

Juhi Poddar

 

Community Alums
Not applicable

Hi @Najmuddin Mohd ,

 

Of course I will be

 

 

com/now/nav/ui/classic/params/target/item_option_new_set.do%3Fsys_id%3D430feb9acc58c846cebb35d2%26sysparm_view%3D%26sysparm_domain%3Dnull%26sysparm_domain_scope%3Dnull

 

 

Actually I was thinking of using item_option_new_set as the table name, but i don't know how to get sysid of a table.

 

What do you think @Brad Bowman  

 

Regards

Suman P.