Default attachment to survey

Niyeeti Dey1
Tera Contributor

How to set default attachment to survey

5 REPLIES 5

Arpan Baishya
Kilo Sage

Hi @Niyeeti Dey1,

 

Are you looking to provide an option for survey participants to add attachments? If so, check out the Attachment question data type here - Survey designer elements (servicenow.com).

No actually I want to attached a file by default whenever my assessments task is created

Hi @Arpan Baishya 

No actually I want to attached a file by default whenever my assessments task is created.

I tried using below script but getting scope application error

 

(function executeRule(current, previous /*null when async*/) {
var gr = new GlideRecord("sys_attachment");
if(gr.get("8f617357c3d9b19032bbd42f0501316")) {
  gr.table_sys_id="e6213fdbc399b19032bbd42f0501310";
  gr.table_name="sn_risk_advanced_cloud_task";
  gr.update();
}
})(current, previous);

Hi,

 

Through this script, you are trying to update an existing record of the Attachment table. What is the reason behind doing that?

 

And could you please share the scope error you are seeing?

 

One more thing, do you want a particular file to get added automatically to the Attachment table every time certain conditions are met (like you mentioned about the creation of assessment task)? Is that your primary objective?