- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-05-2020 11:34 PM
There are 5 variables on record producer which are depend on requested_for.
I want to pass the table name of those 5 tables dynamically in script include.
If I will select first variable,GlideRecord will work on first table.If I select Second table GlideRecord will work on second table for all 5 variables.
Solved! Go to Solution.
- Labels:
-
Service Catalog
-
Service Portal
-
Workflow
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-06-2020 09:53 PM
Got the Solution:
1.We can simply pass table name inside '' from every variable advance reference qualifier
OR
2.We can make system property having value table name and can pass system property in advance reference qualifier.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-06-2020 02:15 AM
Actually it is a custom table(to which variable referring) having no parent table.
now,I can't edit parent table because table is created
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-06-2020 02:51 AM
Hi Amit,
So 5 variables are referring to 5 different custom tables?
line of code suggested by Pradeep should still give you the table name by dot walking to sys_class_name
Can you try to submit the record producer and then query the target record and print the value of the table from scripts background for that variable
var gr = new GlideRecord('table_name');
gr.get('record_sys_id');
var tableName = gr.variables.<variableName>.sys_class_name;
gs.info(tableName);
Regards
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-06-2020 04:17 AM
But Sir,what will I get after submitting record producer?
I need to do it before submitting record producer
It is showing the table name of the variable referring to the table having parent table not for all tables
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-06-2020 04:22 AM
Hi Amit,
just want to check whether you are able to get table name from the variable once record is created and value is present
Regards
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-06-2020 04:24 AM
Yes Sir,It is showing the table name of the variable referring to the table having parent table not for all tables means there is also variables which are referring to a custom table which has no parent table