- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-18-2022 08:31 AM
Hi Everyone,
It is my very first post here (recommendations are always welcome) so I am sorry if it is the wrong way or not the right place for this question... Now let's get to business.
I am new to servicenow so I am not aware of all the different solutions that there might be for my problem, sorry for that.
What I am trying to achieve is: on a catalog item, fetch and display the name and serial number of an asset (listed on the alm_hardware table) that is assigned to a user (user is selected via a reference field on the catalog item itself). And I want to display those two values on two different basic single line text fields.
To tackle this, I guess i'll need an Onchange client script (because the values have to change everytime I change my user in the reference field.
But I have no clue on how to fetch those values, so any help is welcome.
Someone suggested me to use List collectors to get those values, but somehow I can't make them work...
Please help me and thank you in advance for that.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-18-2022 09:26 AM - edited 11-18-2022 09:28 AM
Take a look through this article to see if you can meet your requirements without a script. I think this would satisfy the requirement of retrieving fields from the user table like manager, company, etc, but it's good to know anyway:
To look up the asset(s) assigned to a selected user, you will need to use GlideAjax in an onChange Catalog Client Script to call a Script Include, passing in the value of the user. Here is an excellent walk-through of how to do that.
Give this a shot and post your scripts using the insert code icon </> if you get stuck.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-18-2022 09:26 AM - edited 11-18-2022 09:28 AM
Take a look through this article to see if you can meet your requirements without a script. I think this would satisfy the requirement of retrieving fields from the user table like manager, company, etc, but it's good to know anyway:
To look up the asset(s) assigned to a selected user, you will need to use GlideAjax in an onChange Catalog Client Script to call a Script Include, passing in the value of the user. Here is an excellent walk-through of how to do that.
Give this a shot and post your scripts using the insert code icon </> if you get stuck.