Document ID Field filter
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-14-2025 04:11 PM - edited ‎01-14-2025 04:14 PM
Is there a way to apply filters to the records displayed from source table on a document id field?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-14-2025 05:05 PM
There are number of ways you can achieve based on your instant context and scenario----
How: This is the most common and often the easiest solution. Since the Document ID field ultimately references the sys_document_id table, you can apply a reference qualifier to the field that refers to this table to define how the choices should be displayed.
How: Similar to the previous method, but you use a Script Include to create a dynamic reference qualifier.
How: Create a "before query" business rule on the sys_document_id table to modify the query based on where the field is being displayed.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-14-2025 07:25 PM
what's your business requirement here?
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
‎01-15-2025 08:56 AM - edited ‎01-15-2025 08:58 AM
I want only some records to be shown for the document id field based on the account selected in the form in workspace. Basically I have to filter records based on account field.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-15-2025 05:07 PM
Okay, I understand. You want to filter the records available in the Document ID field within a ServiceNow workspace form so that only Document IDs related to the selected Account are shown.
I provided a detailed explanation in the previous response, but let me reiterate the core steps and tailor them more specifically to the workspace context, along with potential code adjustments:
Steps to Implement in Workspace
Relationship between Document ID and Account (Prerequisite):
Ensure your Document ID table has a reference field pointing to the Account table (e.g., core_company). Let's assume this field is named u_account on the Document ID table.
Advanced Reference Qualifier on Document ID (Workspace):
In your workspace, go to the form/component where you have the Document ID field.
The exact way to configure the field might vary slightly depending on how your workspace component is built. Generally, you'll need to find the configuration settings for the Document ID field.
Look for options related to "Reference Specification" or "Reference Qualifier."
Set the Reference qual type to Advanced.
In the Reference qual field, put a temporary placeholder like: javascript:'u_account=' + current.variables.u_account (We'll update this dynamically. The current.variables part might need adjustment based on your component's context).
Client-Side Scripting (Workspace Client Script or UI Action Client Script):
You'll likely need to add a Client Script to your workspace component or use a UI Action that runs client-side.
The script should be triggered onChange of the Account field.
Please provide the details busienss requirement and which workspace you are tallking about is it ITSM,ITOM OR other LIKE HRSD.provide details and if you like my opitnion and concept then mark it as Accepted solution, I will provide you details script based on your requirement.
If you like my opinion and your problem is resolved after reviewing and applying it. Please kindly mark this your best answer (Accepted Solution) ‌🌠‌ OR mark it Helpful ‌⛑‌ if you think that you get some insight from this content relevant to your problem and help me to contribute more to this community