set a value by using runscript in workflow

Rakhesh
Kilo Guru

Hi ALL,

 

I want to set a field value(string) in approval table by using runscript in Workflow. I wrote one runscript but it did not works. Guys, please have a look once.

 

var gr = new GlideRecord('sysapproval_approver');
gr.addQuery('sysapproval', current.sys_id);
gr.query();
if(gr.next()){
gr.u_approval_type='First leval Approval';// u_approval_type is a field name
}

 

Regards,

Rakhesh

1 ACCEPTED SOLUTION

Erm, from what I see right now - you are trying to execute the script before actually creating the approval. Could you perhaps try to swap the places of the Run Script activity and the Approval activity and see what your logs log then? It just seems like you're trying to edit the record before actually creating it 🙂

View solution in original post

17 REPLIES 17

find_real_file.png

Erm, from what I see right now - you are trying to execute the script before actually creating the approval. Could you perhaps try to swap the places of the Run Script activity and the Approval activity and see what your logs log then? It just seems like you're trying to edit the record before actually creating it 🙂

Brahmi Pandla
Tera Guru

Hello Rakesh,

 

I am trying to set the values to null through workflow run script, but below script not working, could you please help me

BrahmiPandla_0-1735218685845.png