- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-04-2022 08:18 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-05-2022 08:12 PM
From the name of your script, I'm guessing you want to populate a field with the currently logged in user.
For that, you could use the following line of code to set the field 'requested_for' with the current user.
g_form.setValue('requested_for',g_user.userID);
You should check out this developer documentation on the GlideForm API and search for the following to see more information on how to set a value:
setValue(String fieldName, String value)

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-04-2022 08:37 PM
What is the use case to call getReference()?
Display business rule is often used to retrieve data to display on a form. What will getReference() planned to be used?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-04-2022 08:48 PM
Hi,
can you explain your business requirement here with example and screenshot?
what exactly you want to achieve?
Regards
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
‎01-05-2022 11:49 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-05-2022 08:12 PM
From the name of your script, I'm guessing you want to populate a field with the currently logged in user.
For that, you could use the following line of code to set the field 'requested_for' with the current user.
g_form.setValue('requested_for',g_user.userID);
You should check out this developer documentation on the GlideForm API and search for the following to see more information on how to set a value:
setValue(String fieldName, String value)