UI page containing reference field
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-15-2016 06:22 AM
Hi,
I need some help with a UI page (not very familiar with jelly script). So, I would like to have a reference field on the UI page referencing the sys_user table. This UI page will be used on a record producer, so when a user enters a name in that reference field and submits the form, I would like the Name reference field on my table record to be populated.
I have added the following line to my UI page, and the reference field does display on my form, but I'm not sure how to capture the value entered there, then save it on my table record.
<g:ui_reference name="QUERY:active=true^roles=service_desk" id="u_name" table="sys_user" style="width:180px"/>
Any assistance would be appreciated.
Thanks,
Maria

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-15-2016 06:26 AM
Hi Maria,
While you CAN put the query in the name field, I feel it confuses things. Try this instead:
<g:ui_reference name="my_var" query="active=true^roles=service_desk" id="u_name" table="sys_user" style="width:180px"/>
I don't think style is going to do you any good.
You can then use the processing script to get your hands on the my_var value and save it using a server side script. See section 4 here:
http://wiki.servicenow.com/index.php?title=UI_Pages
For additional help - see videos 1, 2, 3 on this list: TechNow Episode List
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-15-2016 02:23 PM
Thanks, Chuck! I'll give this a try.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-10-2018 01:50 PM
How can I use a UI reference variable to only show one column? so that the search occurs in that column
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-15-2016 06:28 AM
Use something like below. It will show in the UI Page.
<g:ui_reference label="Name" name="name" table="sys_user" field="user_name" />