Inserting a new record into a table via the workflow

Shamir Mawji
Kilo Expert

Hello folks,

Hoping you can help.

I have a variable set and I want the variables on the variable set to be inserted into a table as a new record.

I have a "Run Script" on the workflow as below. This just shows 3 of the variables as an example. 

var server = new GlideRecord('server');
server.initialize();
server.name = current.variables.server_name;
server.install_status = current.variables.server_status;
server.internal_contact = current.variables.server_internal_contact;
server.insert();

A new record is being created however the fields are not being populated with the variables and are being left empty as below. 

find_real_file.png

I am not sure if I should be using current.variables to call a variable from a variable set... 

Any ideas please? 

Cheers

Shamir 

1 ACCEPTED SOLUTION

rad2
Mega Sage

Check for the following and try 

internal contact(primary) - seems to be a reference field. if it is then assign the sys_id

Status - add the value of the choice label.

 

Hope this helps!

 

View solution in original post

1 REPLY 1

rad2
Mega Sage

Check for the following and try 

internal contact(primary) - seems to be a reference field. if it is then assign the sys_id

Status - add the value of the choice label.

 

Hope this helps!