- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-07-2025 03:54 AM
Hi all,
I have created a string field on " sn_sam_software_installation_task" table called as Name, I want to copy the variable called "device" value into Name field So I am using the flow designer but I am getting below error.
but when I tried to add logs I am getting the correct value.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-07-2025 09:17 AM
if the field is on parent and you are creating record on child table then that field will be inherited so no issue in that.
I hope it's not the reverse
If my response helped please mark it correct and close the thread so that it benefits future readers.
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-07-2025 04:26 AM
it's a reference variable on that catalog item.
So did you try inline script and see if it works
var variableValue = fd_data._1__get_catalog_variables.device.toString();
gs.info(variableValue); // see what comes here
// now query that table being referred by device table with this sysId and get the name field
var gr = new GlideRecord("tableName");
gr.addQuery("sys_id", variableValue);
gr.query();
if (gr.next()) {
gs.info(gr.name); // ensure you pick correct name field
return gr.name.toString(); // ensure you pick correct name field
}
If my response helped please mark it correct and close the thread so that it benefits future readers.
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-07-2025 04:49 AM
So are you sure that device where it's not working has name field as empty value?
Since it's an intermittent issue, it looks like a data issue and not config issue.
If my response helped please mark it correct and close the thread so that it benefits future readers.
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-07-2025 06:28 AM - edited 04-07-2025 06:29 AM
Hi @Ankur Bawiskar ,
I have tried with below script
var deviceId = fd_data._1__get_catalog_variables.device.toString();
gs.info("ujwala 1 device:"+deviceId);
var grComputer = new GlideRecord('cmdb_ci_computer');
grComputer.addQuery('sys_id',deviceId);
grComputer.query();
if(grComputer.next())
{
gs.info("ujwala 2 name:"+grComputer.name.toString());
return grComputer.name.toString();
}
The logs is showing above value and the error is still same
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-07-2025 06:36 AM
share the device variable config screenshot
I could see in logs it's already a GlideRecord object so try this
var deviceId = fd_data._1__get_catalog_variables.device.sys_id;
gs.info("ujwala 1 device:"+deviceId); // check if this prints the sysId of the device selected
var grComputer = new GlideRecord('cmdb_ci_computer');
grComputer.addQuery('sys_id',deviceId);
grComputer.query();
if(grComputer.next())
{
gs.info("ujwala 2 name:"+grComputer.name.toString());
return grComputer.name.toString();
}
If my response helped please mark it correct and close the thread so that it benefits future readers.
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-07-2025 06:52 AM - edited 04-07-2025 07:07 AM
The logs are working now but error is there, even I tried to simply give a hardcoded value as test the error is still there.