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

Did this not work for you?

I have tested this and it works.

-Anurag

No @Anurag Tripathi ,

 

<g:ui_reference name="caller_id" table="sys_user" value="${gs.getUserID()}" displayvalue="${gs.getUser().getUserByID('sys_id of user record').getDisplayName()}" />

 

This populates my current logged in user record even though i pass a different user record's current ID and also it doesn't display anything on the field ..

hardcode the sys_id and test. 

I tested this and it works well so there is no issue with the code here.

-Anurag

The eye icon, when clicked, displays the required record during onload. Also during onload , the caller field doesn't display anything.  Tried the below and when I submit my form, the caller field is blank.. 
<g:ui_reference name="caller_id" table="sys_user" value="hardcoded the sys id" displayvalue="${gs.getUser().getUserByID('hardcoded the sysid').getDisplayName()}" />

Add a screenshot also explaining what you see and what you expect

-Anurag