- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-20-2023 12:36 AM
Hello!
I have a custom table containing a field that references the User table. I want this field to have a Default value. Is this possible? I tried inputting the User ID, name, sysID of the User but it does not work.
Please help!
Thanks.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-20-2023 12:47 AM
you need to put the sysId of the user record you want to see as default value
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-20-2023 12:47 AM
you need to put the sysId of the user record you want to see as default value
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-20-2023 12:55 AM
Is this best practice or should I use a System Property?

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-20-2023 12:57 AM - edited ‎04-20-2023 12:57 AM
You can also use a system property use it as follows
javascript:gs.getProperty('some.default.user.sysid');
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-20-2023 01:31 AM
not recommended to use hard-coded sysId
1) create a system property of type string and store the sysId there
2) then in default value use this
javascript: gs.getProperty('propertyName');
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader