Not entering while Loop for getting models for a user
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-22-2024 12:54 AM - edited 05-22-2024 01:31 AM
Hi everyone,
I have written a script, where I need to get all models for certain user when the Extend to Order for Others is true. I am getting exact values through background script, but in main script its not entering while loop.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-22-2024 02:48 AM
Hi @venugopal s
Check whether the Order By field is having the sys_id of the user. While getting the sys_id try to use orderby.toString(). It is recommended to use toString() function whenever you are dealing with "Sys_id's" Let me know if you have any questions.
Regards,
Lithesh
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-22-2024 04:23 AM
please share the complete script and how are you invoking?
seems some issue with field name and value in query
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-22-2024 04:30 AM
@Ankur Bawiskar ,
I modified script and getting value for entitleModelId, not able to show in the payload. Thanks
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-22-2024 04:38 AM
sorry but without the relevant script and screenshots we can't help
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader