Join the #BuildWithBuildAgent Challenge! Get recognized, earn exclusive swag, and inspire the ServiceNow Community with what you can build using Build Agent.  Join the Challenge.

Default value for a reference field on UI page

Swetha M
Mega Guru

How to set a particular caller name as default value in Caller field(reference) on an incident form UI page.

25 REPLIES 25

What are you seeing, please share the code and what you are seeing as well.

-Anurag

The open record in a new window(eye symbol) near caller field opens the default caller record. But i dont see a display valueThe open record in a new window(eye symbol) near caller field opens the default caller record. But i dont see a display valueThe codeThe code

just tried this and it works fine for me, in modal as well as full page

AnuragTripathi_0-1679588834763.png

 

AnuragTripathi_1-1679588875833.png

 

 

-Anurag

Yes this would pull the current logged in user but I want a specific user record to be a default user.

Use this, pass the correct sys_id.

I have tried and this works

<g:ui_reference name="ref" table="sys_user" value="${gs.getUserID()}" displayvalue="${gs.getUser().getUserByID('62826bf03710200044e0bfc8bcbe5df1').getDisplayName()}" />
-Anurag