- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-23-2020 07:27 AM
Hi,
I am creating a new portal form for line managers to report that their employee who has left the company will be returning their equipment, so the desktop team can arrange for the equipment (laptop etc) can be returned. On the form I want to pull through the assets which the employee has assigned to them in the alm_asset table.
I am thinking that a good way to do this would be once the line manger has opened the new portal form, and completed who the equipment to be returned for in a user drop down from the sys_user table an asset drop down box will appear with the asset(s) which the person selected in the box above has.
is there a simple script I could use to do this?
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-23-2020 07:39 AM
Hi,
I consider you must be using catalog item for this; the approach looks good; just ensure both the variables are of type reference
1) user reference to sys_user table
2) assets reference to possibly alm_asset table
Ensure you add reference qualifier to the 2nd variable to show only those assets assigned to that selected user
javascript: 'assigned_to=' + current.variables.user;
Mark ✅ Correct if this solves your issue and also mark 👍 Helpful if you find my response worthy based on the impact.
Thanks
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
09-14-2021 02:08 AM
Perfect thank you for such a quick reply. I was missing the ^ before the model_category
Thanks Ankur
Mark
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-14-2021 02:41 AM
Glad to help.
Please mark response helpful
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-23-2020 07:41 AM
Hi,
You can use reference qualifier on Assets variable.
Reference qualifier on Assets variable:
javascript: 'assigned_to='+current.variables.<<user variable name>>; //replace with user variable
If I have answered your question, please mark my response as correct and/or helpful.
Thanks,
Suseela P.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-02-2025 10:33 PM
Hi ,
Firstly, @Ankur Bawiskar, thank you for providing such a simple and effective approach with the reference qualifier – it was really useful. Furthermore, I would like to propose adding an extra condition to further refine the query incase of an OR condition.
Imagine their is 2 model category then the Qualifier would be: -
javascript: 'assigned_to=' + current.variables.requested_for+ '^model_category=ea34ac80db416f40d0f9b5ca689619de^ORmodel_category=abcd2345687654324567de^EQ';
Please mark it as helpful if you found this useful✅.
Thanks
Warm Regards
Ravindra H V