copy the same variable editor from one RITM to another RITM. i am creating multiple RITM's with single request, so for first RITM it is automatically coming from second i need this variable editor.

Sai25
Giga Guru

Hi Team,

 

i am trying to copy the same variable editor from one RITM to another RITM. i used "com_glideapp_servicecatalog_veditor" but it is not working.The variable editor is getting in the RITM0012247 but i need the same in RITM0012248.

find_real_file.png

find_real_file.png

 

 

could you please help me with this scripting in workflow activity - Run Script.

 

 

var listStr =current.variables.select_user.toString();
var list = listStr.split(',');

if(list!=''){

for (var i = 0; i < list.length; i++) {

var ritm = new GlideRecord('sc_req_item');
ritm.newRecord();
ritm.request = current.request;
ritm.cat_item=current.cat_item;
ritm.opened_by=current.opened_by;
ritm.due_date=current.due_date;
workflow.scratchpad.com_glideapp_servicecatalog_veditor=current.com_glideapp_servicecatalog_veditor;
ritm.insert();

}
}

 

Thanks,

Sai.

6 REPLIES 6

scott barnard1
Kilo Sage

Hi Sai check out the product docs on scratchpad and variables

 

Workflow scratchpad variables

Store and share string-based variables as name-value pairs between workflow activities.

The scratchpad is global to the instance of the running workflow and as such, is available equally to all activities.

Declaration

The scratchpad itself is automatically available to an executing workflow and requires no specific declaration. Variables are declared and stored in the scratchpad simultaneously by referencing it. For example:
workflow.scratchpad.variableName = variableValue;

Display

View activity scratchpad values from the Workflow Activity History Scratchpad [wf_history_scratchpad] table. Workflow Activity History Scratchpad is also an embedded list in Worfklow Activity History records.

Sample Workflow Activity History Scratchpad records

Access and Assignment

Use standard JavaScript object notation to access or assign scratchpad values. For example, use this format to assign a particular scratchpad variable value.
workflow.scratchpad.variableName = variableValue;
Use this format to assign a JavaScript variable to a scratchpad variable.
var myValue = workflow.scratchpad.variableName;

So basically take all of your base variables and put them into the scratchpad, then each time you generate a ritm call the scratchpad values into your task