- 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-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-06-2025 09:07 PM
Hello @Hafila Hatta
We are glad your issue is solved.
If any of our solution has help you, do hit like button and yes as per new community feature you can mark multiple correct answers.
Thanks & Regards,
Viraj Hudlikar.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-04-2025 07:22 PM
Hello @Hafila Hatta
Can you cross check what value is passed for line 4 by adding a log statement, this will help you to understand are you doing Gliderecord with proper field value also what field you are getting value is correct field name? Also the value return is it correct datatype for which the field you are updating.
If my response has helped you hit helpful button and if your concern is solved do mark my response as correct.
Thanks & Regards
Viraj Hudlikar.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-04-2025 09:04 PM
hi! i've tested the script in scripts background so it is working fine, no issue with line 4.
how do i know if its correct datatype? the table field type is integer and i am trying to pass integer value. the idea is to get whatever value from the field and minus it by 1 and update that value in the table field.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-04-2025 09:21 PM
did you add logs as per my suggestion and see what it gave?
can you try this? and use parseInt()
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 = parseInt(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