- 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
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
03-23-2020 08:59 AM
Amazing thank you so much 🙂

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-14-2021 01:54 AM
Hi
Thanks for the above. I have an additional ask on how you can restrict the qualifier to only being of a certain model category.
What I have done is taken you code
javascript: + 'assigned_to=' + current.variables.requested_for ;
And updated this to
javascript: + 'assigned_to=' + 'model_category=ea34ac80db416f40d0f9b5ca689619de^EQ' + current.variables.requested_for
*model_category is mobile phones
Unfortunately this returns all devices under that model and not the one that is assigned to the 'assigned_to'
Kind Regards
Mark
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-14-2021 02:01 AM
Hi,
something like this
javascript: 'assigned_to=' + current.variables.requested_for + '^model_category=ea34ac80db416f40d0f9b5ca689619de^EQ';
Regards
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader