|
| 1 | +--- |
| 2 | +title: Discover ServiceNow Custom Tables |
| 3 | +sidebar_label: Discover ServiceNow Custom Tables |
| 4 | +--- |
| 5 | + |
| 6 | +# Discovering ServiceNow Custom Tables |
| 7 | + |
| 8 | +In this guide, you will: |
| 9 | + |
| 10 | +- Learn how to discover and manage records from custom ServiceNow tables in Turbot Guardrails |
| 11 | +- Configure table discovery, filtering, and record title display settings |
| 12 | +- Set up optional business rules for custom table management |
| 13 | + |
| 14 | +Turbot Guardrails can discover and manage records from any specified ServiceNow table, extending visibility beyond the pre-configured Application, Cost Center, and User tables. This allows you to bring data from your custom or other standard ServiceNow tables into Guardrails as `ServiceNow > Custom > Record` resources. |
| 15 | + |
| 16 | +## Prerequisites |
| 17 | + |
| 18 | +- An active ServiceNow instance integrated with Turbot Guardrails following the [Importing a ServiceNow instance into Guardrails](/guardrails/docs/guides/servicenow/import-servicenow-instance) guide. |
| 19 | +- The `@turbot/servicenow-custom` mod installed in your Guardrails workspace. See [Install a Mod](/guardrails/docs/guides/configuring-guardrails/install-mod). |
| 20 | +- Administrator access to your ServiceNow instance. |
| 21 | +- Administrator access to your Turbot Guardrails workspace. |
| 22 | + |
| 23 | +## Enabling Custom Table Discovery |
| 24 | + |
| 25 | +To enable discovery of records from ServiceNow custom tables, configure the following policies: |
| 26 | + |
| 27 | +### ServiceNow > Custom > Table > CMDB |
| 28 | + |
| 29 | +- Enables the discovery for custom tables. |
| 30 | +- Set this policy to `Enforce: Enabled` at the scope of your ServiceNow instance resource or higher. |
| 31 | + |
| 32 | +### ServiceNow > Custom > Table > CMDB > Tables |
| 33 | + |
| 34 | +- Specifies the list of ServiceNow table names you want Guardrails to discover records from. |
| 35 | +- Provide a YAML list of table names e.g. `["u_custom_table", "cmdb_ci_storage_volume"]`. |
| 36 | +- Defaults to an empty list `[]`. |
| 37 | + |
| 38 | +> [!IMPORTANT] |
| 39 | +> Removing a table name from this list will result in the deletion of the corresponding `ServiceNow > Custom > Table` resource and all its child `ServiceNow > Custom > Record` resources from the Guardrails CMDB. |
| 40 | +
|
| 41 | +## Set Optional Policies |
| 42 | + |
| 43 | +The following two policies allow you to control which records are discovered and how they are displayed in Guardrails: |
| 44 | + |
| 45 | +### ServiceNow > Custom > Record > CMDB > Query |
| 46 | + |
| 47 | +- Allows you to refine which records are discovered by applying [ServiceNow encoded query string](https://www.servicenow.com/docs/bundle/yokohama-platform-user-interface/page/use/using-lists/concept/c_EncodedQueryStrings.html). |
| 48 | +- Useful for limiting discovery to specific records that match your criteria. |
| 49 | +- For example, filter by status, category, or any other field available in the ServiceNow table |
| 50 | +- Defaults to `""` (empty string) which means all records will be discovered. |
| 51 | + |
| 52 | +### ServiceNow > Custom > Record > CMDB > Title |
| 53 | + |
| 54 | +- Specifies the data key(s) used to retrieve the title for discovered `ServiceNow > Custom > Record` resources in Guardrails. |
| 55 | +- Provide an array of strings representing field names in order of preference e.g. `["name", "display_name", "sys_id"]`. Guardrails uses the first field in the list that contains a non-empty value. |
| 56 | +- This allows for fallback options if preferred fields are missing or empty. |
| 57 | +- Defaults to `["name", "display_value", "display_name", "title", "label", "short_description", "number", "sys_name", "sys_title", "sys_id"]`. |
| 58 | +- Customize by creating a new policy setting. |
| 59 | + |
| 60 | +<!-- ### Business Rule for Event-Driven Updates (Optional) --> |
| 61 | + |
| 62 | +## (Optional) Configure Real-time Business Rules |
| 63 | + |
| 64 | +To enable real-time updates when records change in ServiceNow, you can configure Business Rules. This allows Guardrails to automatically sync changes as they happen in ServiceNow. |
| 65 | + |
| 66 | +Before configuring Business Rules, ensure you have: |
| 67 | + |
| 68 | +1. Set `ServiceNow > Config > System Properties` to `Enforce: Configured` as described in the [ServiceNow sync prerequisites](/guardrails/docs/guides/servicenow/servicenow-to-guardrails-sync#prerequisites). |
| 69 | +2. Administrator access to create Business Rules in ServiceNow |
| 70 | + |
| 71 | +### ServiceNow > Custom > Table > Business Rule |
| 72 | + |
| 73 | +Configures ServiceNow Business Rules for real-time event handling of record changes (new, updated, deleted) in the discovered tables. |
| 74 | + |
| 75 | +- Set to `Enforce: Configured` to enable automatic setup and management. |
| 76 | + |
| 77 | + |
| 78 | +### ServiceNow > Custom > Table > Business Rule > Name |
| 79 | + |
| 80 | +- Allows customization of the Business Rule name. |
| 81 | + |
| 82 | +## Example: Discovering the Server Table |
| 83 | + |
| 84 | +To discover records from the standard ServiceNow Server table `cmdb_ci_server`, follow these steps: |
| 85 | + |
| 86 | +1. Set `ServiceNow > Custom > Table > CMDB` to `Enforce: Enabled`. |
| 87 | +2. Set `ServiceNow > Custom > Table > CMDB > Tables` with yaml value as `- cmdb_ci_server` |
| 88 | + |
| 89 | + |
| 90 | + |
| 91 | +3. (Optional) To only discover active servers, set `ServiceNow > Custom > Record > CMDB > Query` to `active=true` (or the relevant field/value for server status). |
| 92 | +4. (Optional) To enable real-time updates, set `ServiceNow > Custom > Table > Business Rule` to `Enforce: Configured`. |
| 93 | + |
| 94 | + |
| 95 | + |
| 96 | +Guardrails will now discover records from `cmdb_ci_server`. These records will appear in your Guardrails inventory under the ServiceNow instance resource as `ServiceNow > Custom > Record` resources. |
| 97 | + |
| 98 | + |
| 99 | +## Next Steps |
| 100 | + |
| 101 | +Please see the following resources to learn more about ServiceNow integrations: |
| 102 | + |
| 103 | +- [Enable ServiceNow to Guardrails Sync](/guardrails/docs/guides/servicenow/servicenow-to-guardrails-sync) |
| 104 | +- [Enable Guardrails to ServiceNow Sync](/guardrails/docs/guides/servicenow/guardrails-to-servicenow-sync) |
| 105 | + |
| 106 | +## Troubleshooting |
| 107 | + |
| 108 | +| Issue | Description | Guide | |
| 109 | +| ------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------- | |
| 110 | +| Common errors | Common issues that may prevent controls from running include network connectivity problems, permission issues, and API rate limits. These can cause controls to enter an error state. | Refer to [Common Troubleshooting](/guardrails/docs/guides/troubleshooting) for detailed resolution steps. | |
| 111 | +| Further Assistance | If you encounter further issues with Calculated Policies, please open a ticket with us and attach the relevant information to assist you more efficiently. | [Open Support Ticket](https://support.turbot.com) | |
| 112 | +| Community Support | We want to hear from you! Join our [Slack Community](https://turbot.com/community/join) `#guardrails` channel to ask questions and share feedback. | [Join Slack Community](https://turbot.com/community/join) | |
0 commit comments