- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-26-2022 01:39 AM
Hello,
Can anyone help me with the logic to set a string value field on one table same as a reference value field on another table?
Scenerio:
I have two fields: 'assigned to' is a reference field in one table & 'Ops lead' is a string field in another table.
'Ops lead' need to be same as 'assigned to' and if assigned to is changed, the other needs to replicate.
Any assistance would be extremely helpful and appreciated.
I am self taught scripter so I'm novice.
Thank You
Solved! Go to Solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-26-2022 11:49 PM
try below script:
var gr = new GlideRecord("SECOND_TABLE_NAME");
gr.addQuery("sys_id", current.getValue(("NUBMER_FIELD_BACKEND_NAME"));
gr.query();
if(gr.next()){
gr.OPS_LEAD_FIELD_NAME = current.getDisplayValue("ASSIGNED_TO_FIELD_NAME");
gr.update();
}
Note: update field names in above script as in your table.
Thank you,
Ali
Thank you,
Ali

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-26-2022 11:49 PM
try below script:
var gr = new GlideRecord("SECOND_TABLE_NAME");
gr.addQuery("sys_id", current.getValue(("NUBMER_FIELD_BACKEND_NAME"));
gr.query();
if(gr.next()){
gr.OPS_LEAD_FIELD_NAME = current.getDisplayValue("ASSIGNED_TO_FIELD_NAME");
gr.update();
}
Note: update field names in above script as in your table.
Thank you,
Ali
Thank you,
Ali
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-27-2022 01:02 AM
Thank you @Ahmmed Ali its working.