Find your people. Pick a challenge. Ship something real. The CreatorCon Hackathon is coming to the Community Pavilion for one epic night. Every skill level, every role welcome. Join us on May 5th and learn more here.

How can I set Dynamic default value for a reference field?

demet1
Giga Contributor

Hi, 

I am creating a new app and it has a table that contains a reference field. The reference field's name is 'Assigned to' and it uses 'sys_user' table. I need to set 'dynamic default value'. Its label 'Sender' and its script is 'gs.getUserID();' 

However it is not working and give me the error 'Invalid default value'. How can I solve this problem?find_real_file.png

Thanks for advance.find_real_file.png

8 REPLIES 8

Anurag Tripathi
Mega Patron

Hi,

Do need to set the value of the logged in user on the filed ?

If so, then set the 'default value' on the dictionary as 'javascript:gs.getUserID()'. 

PS, uncheck the 'dynamic default', and just add the 'default value'.

-Anurag

-Anurag

Hi, 

I did what you said but I got the same error.

Thanks.

Can you show a screenshot of the dictionary with error?

-Anurag

Ankur Bawiskar
Tera Patron

Hi,

Is this happening with admin or non-admins.

Regards
Ankur

Regards,
Ankur
Certified Technical Architect  ||  10x ServiceNow MVP  ||  ServiceNow Community Leader