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

Hi, 

There is no role set to this dynamic default value. I also cannot see de predefined dynamic value when I search it.

Thanks.find_real_file.pngfind_real_file.png

On the second screenshot i see the column label being blank, that is giving you the invalid insert error.

1) clear out the value 'sender' from dynamic default value

2) Uncheck Dynamic default checkbox

3) add the default value that i gave previously to the dynamic default column(this shows up when you have unchecked the dynamic default checkbox)

4) make sure other mandatory fields on the form are filled

5) Save

-Anurag

After I save the field, the column label is automatically being blank because the error. And I tried what you said before. It did not work either.

Hi,

Please follow steps mentioned by Anurag,

1st fix the Column label empty issue

Columns showing a blank or (empty) column label

Regards
Ankur

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