How to auto populate a users id from the name using the sys_user table
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-26-2022 01:42 PM
Hello everyone I've been having some issues on auto populating a user id from a name reference. The table that I have been using is the sys_user. I have the variables in a variable set and the names of the variables are empl_name and the one for the ID is empl_id. I have tried a few codes i have found on the forums but cant seem to get it working. I am still relatively new at this so any help is appreciated.
- Labels:
-
Service Catalog
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-26-2022 01:49 PM
Hi Roisee,
Can you share the codes that you have found and tried? What was the result of those?
If you can share a screenshot that helps people get involved and have a visual of what it is you want to do.
Kind regards,
Willem

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-27-2022 09:41 AM
I have built and validated a method that works to pull information from the user table through an AJAX connection. I have documented it in the following post:
Auto Populate User Details using AJAX
Let me know if you have any questions and/or issues.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-28-2022 12:00 PM
I was actually use your documentation to solve my issue but seems like I have something wrong in the code because I get a undefined value when it populates. I am trying to get the ID to populate when a name is selected
the script include is the same as the one from the forum

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-28-2022 01:46 PM
What type of field is the name field? If it is not a reference field that points to the User [sys_user] table, then it cannot look up the user record and gives you undefined. Try putting in some comments to see what is being passed as newValue as well as what comes back for answer.