- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-25-2025 12:44 AM
Hello All,
I am working on a requirement where on a record producer the requirement is to auto populate a field where there is only one record referenced within it. I have tried using a catalog script for this, but it is not working.
Anyone have a script or a method where they have this working? Or knows how to do it?
Here is my current code.
Catalog client script
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-25-2025 04:51 AM
are you testing with admin or non-admin?
if non-admin then ensure user has read access on table "sn_install_base_sold_product"
In my instance there are lot of records and I tested with setLimit(1) and it worked.
Output: It gave me 1 record for me correctly
If my response helped please mark it correct and close the thread so that it benefits future readers.
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-25-2025 03:35 AM
Correct in the default value field present on that variable configuration
I hope your variable is reference type and referring "sn_install_base_sold_product" table
If my response helped please mark it correct and close the thread so that it benefits future readers.
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-25-2025 04:22 AM
Thanks again for your response. I have tried this, but it does not work unfortunately. The variable is referencing the "sn_install_base_sold_product" table as well.
Did you try this yourself was it working?
Kind Regards,
Luke
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-25-2025 04:51 AM
are you testing with admin or non-admin?
if non-admin then ensure user has read access on table "sn_install_base_sold_product"
In my instance there are lot of records and I tested with setLimit(1) and it worked.
Output: It gave me 1 record for me correctly
If my response helped please mark it correct and close the thread so that it benefits future readers.
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-25-2025 06:35 AM
I believe I have shared a working solution with output and also guided you to debug further.
If my response helped please mark it correct and close the thread so that it benefits future readers.
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader