- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-04-2025 06:54 PM
hi. i keep getting this error in my flow. could anyone help to with this error? not sure if my script is the issue
here is my script:
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-06-2025 08:59 PM
hi. solved this issue. apparently, no issue with the script but the 'look up' action was not returning any result. just had to change the look up condition to sys_id field and it works fine.
thanks for ur help
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-04-2025 06:57 PM
did you try to add logs and see?
are you querying with the correct table and field?
var acc_name = fd_data._3__for_each.item.accessory;
gs.info('Acc name' + acc_name);
var var_count = new GlideRecord('u_inventory_accessories_count');
var_count.addQuery('sys_id', acc_name);
var_count.query();
if (var_count.next()) {
gs.info('Inside record found');
var result = var_count.getValue('u_current_stock_count');
var new_result = result - 1;
gs.info('result' + result);
return new_result;
}
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
03-04-2025 07:09 PM
yes, it is the correct table and field. getting the same error using ur script
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-04-2025 08:34 PM
did you add logs as per I shared and check which came fine?
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
03-06-2025 08:54 PM
Any update to this?
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader