Update custom table from a catalog item
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
ā03-05-2019 07:36 AM
Hello,
I need some help with the following scenario:
Looking to update the fields on a custom table from a catalog item. On the catalog item I have a field with reference to my custom table and 5 fields. Each field from the catalog item corresponds with a field from my custom table.
Looking to update one field, or two, or all from that catalog item. I was thinking to query the custom table and maybe map the fields but not sure how.
Any ideas?
Thanks,
Alex

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
ā03-05-2019 07:45 AM
Use run script activity and try the below code
var gr = new GlideRecord("your_custom_table");
gr.addQuery("sys_id", current.variables.REFRENCE_VARIABLE_NAME);
gr.query();
if (gr.next()) {
gr.FIELD_NAME_ON_TABLE = current.variables.VARIABLE_NAME;
gr.update();
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
ā03-05-2019 07:47 AM
Hi dvp.
That example is for one variable, but if I want to update 3 or 4 variables what should I do?
Thanks

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
ā02-11-2020 06:08 AM
Hi DVP,
Have a question!
I have already inserted variable values in my custom table. I used a bit different code, but created run script in workflow before task creation. It works great. Please see screen shoot attached. The only that doesn't work correctly is that the system populates in the 1st field of my table - RITM number and I need SCTASK.
I understand why it happens, the SCTASK hasn't been created by then, so I understand that I need to update the table and to run a similar code that you have been offering, but I don't understand where should I do it?
Do you think Client Script OnLoad for this catalog item might help?
The goal is to have all this information in the related list of the SCTASK record.
Please see below:
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
ā03-17-2022 09:38 AM
can you share your code (which you said it is a bit different) here please?