How to set default value in in reference variable in service catalog ?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-12-2024 01:27 AM
I have one variable in service catalog type is Reference.
I want to set default value (unique value not from record).
Default tab - not working.
So, any other way to set default value it.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-12-2024 01:39 AM
Hi,
Please explain further.
You want to add a default value to a reference field, that is not a reference from the table referenced ?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-12-2024 01:42 AM
correct.
ex. my reference variable populating tariff plans.
like heading i have to set default value that Standard plans.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-12-2024 02:13 AM
Not sure what you mean.
But if it is a reference field you're using, it will expect a (valid) sysID as value.
If you enter anything else it will show up as empty selection, and the reference picker available, showing "No preview available" since the value doesn't point to a valid record in that table.
If it is a sysID on the table that should be shown, then either set the value as default value directly (risky since it's basically hard coding a sysID, and that's rarely a good option), or you call a script include (like Mark suggested) that returns the result you want given different circumstances.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-12-2024 02:17 AM
ok, will try.
Thanks

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-12-2024 01:45 AM
Hi there,
Should be possible. Also with the default value field, not immediately a Catalog Client Script needed, just calling a Script Include function should work fine.
Question is though, how is that dynamic record populated? What is doing that or how or when? Based on that we can brainstorm with you for a solution.
Kind regards,
Mark Roethof
Independent ServiceNow Consultant
10x ServiceNow MVP
---
~444 Articles, Blogs, Videos, Podcasts, Share projects - Experiences from the field