# Class Definitions and Cross-Scope Privileges

This article describes the essential steps to configure Designer to access ServiceNow data.

## Before you get started

**Important**: The metamodel is not your target but provides the backbone to interconnect your enterprise data. Designer is model agnostic. Just make sure you have the metamodel in place to answer your business questions.

You need to understand and govern the tables & relationships used by your target audience. Otherwise, Designer users will not find the essential data and can't perform their job of creating outstanding Diagrams & models.

Ensure your target metamodel (tables, fields, relationships) is implemented in ServiceNow, and you have a good idea about all interdependencies required. Please check if the following is in place in ServiceNow before you proceed:

* Tables (sys\_db\_object)
* Relationship Types (cmdb\_rel\_type)
* Suggested Relationships (cmdb\_rel\_type\_suggest)

## Accessing ServiceNow data through Designer

Users can create diagrams in Designer to represent data from ServiceNow tables via the Repository Browser. To do so, you need to have the following in place:

| Feature                        | Description                                                                                                          | Table Name                        |
| ------------------------------ | -------------------------------------------------------------------------------------------------------------------- | --------------------------------- |
| Class Definitions              | Define the tables and shape styling in the Class Definitions to make the tables available in the Repository Browser. | x\_inpgh\_des\_class\_definitions |
| Application Cross-Scope Access | ServiceNow feature to provide read and create rights to applications outside of the Global scope.                    | sys\_scope\_privilege             |

By default, Designer adds up to 100 tables to the Repository Browser; however, ServiceNow admins may wish to make additional tables available or exclude specific tables for users. Adding a table requires creating a new Class Definition.

As Designer is a scoped application and does not have access rights by default to other ServiceNow tables, a **read** cross-scope privilege needs to be created. To commit future-state elements, a **create** cross-scope privilege needs to be created for the same table.

There are further optional configuration steps available to maximize the value out of Designer:

| Feature                  | Description                                                                                                                                                          | Table Name                                         |
| ------------------------ | -------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------- |
| Class Fields             | Can be configured as part of the Class Definitions for a table to show selected fields in the form view in Designer while creating and editing Future State Elements | Related list on the Class Definitions table        |
| Relationship Definitions | Change the styling for suggested relationship types, so they automatically apply when used in Designer.                                                              | x\_inpgh\_des\_relationship\_definitions           |
| Relationship Fields      | Define the fields on relationships, which can be edited for Future State Relationships                                                                               | Related list on the Relationship Definitions table |

## Create and edit Class Definitions

There are two ways to create Class Definitions in ServiceNow:

1. Create Class Definition in list view
2. Create a Class Definition through a Shape

### Create Class Definition in list view

Navigate to **Dgner > Configuration > Class Definitions** or use the following link to access the Class Definition table:

```
https://YOUR-INSTANCE.service-now.com/x_inpgh_des_class_definitions_list.do
```

1. Click the **new** button.

![Screenshot 2022-08-24 at 15.21.40.png](/files/KUlk0RZONDXkETsBauCO)

2. Complete the fields on the Class Definitions form:

![Create Class Definitions.gif](/files/lDvfW4RGUdmvIEY9L7WI)

| Field        | Description                                                                                                                                                                   |
| ------------ | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Active       | Activates/deactivates the Class Definition. Set active to make the table visible in the Designer Repository Browser.                                                          |
| Category     | Optional field to group Class Definitions within the list view. This field has no further logic within Designer!                                                              |
| Table        | Select the table you want to show in the Designer Repository browser to access the data.                                                                                      |
| Display Name | The field is shown in the search and the shape, i.e., typically the "name" field.                                                                                             |
| Width        | The width of the shape.                                                                                                                                                       |
| Height       | The height of the shape.                                                                                                                                                      |
| Read Table   | Activate to automatically create a cross-scope privilege that enables "read" access to the specified table. Requires setting cross scope privileges automatically.            |
| Allow Commit | Activate to automatically create a cross-scope privilege that enables "create" (commit) access to the specified table. Requires setting cross scope privileges automatically. |
| Style        | Style of the shape. Select a shape in Designer and click CTRL+E and copy/paste into this field.                                                                               |

3. Click the "**Submit**" button to create the new Class Definition.

{% hint style="warning" %}
**Reload Designer to apply changes**

The Class Definitions are loaded initially when Designer is starting. Please refresh your browser or start Designer new to load the changes applied above.
{% endhint %}

### Create a Class Definition through a Shape

The quickest way to create a Class Definition by leveraging the shape styling is the following:

1. Navigate to **Designer > Shape > Shape Libraries** and select a library.

![Screenshot 2022-08-24 at 16.04.45.png](/files/LowSAQdJAujXCzrPe43W)

2. Select a shape within the library.
3. Click the "**Create Class Definition**" button.

![Shape Class Definition.gif](/files/uvn1R9zAIDKhWXu4CG7J)

{% hint style="danger" %}
**Error messages**

If you are getting "**Access to api...**" error messages, this is due to missing rights for Designer on the Cross-scope privilege table. You can fix this issue by setting cross scope privileges automatically, or setting the cross scope privileges manually.
{% endhint %}

## Setting Cross Scope Privileges

Designer is a scoped application and requires '**Cross Scope Privileges**' to be able to read tables or create entries in tables (commit) if required.

Before you create a new Cross Scope Privilege, ensure that your Application Scope is set to Designer! This will make sure that the "Source Scope" is set automatically to Designer.

![Screenshot 2022-08-24 at 16.27.29.png](/files/tfYztAtj8XguwLowlYGa)

Ensure Application scope is Designer

1. Navigate to "**System Applications > Application Cross-Scope Access**"
2. Click the "**New**" button

![Screenshot 2022-08-24 at 16.28.08.png](/files/Qnw9OnuIRJ290BVczUhY)

3. Complete the fields on the Cross Scope Privilege form:

![Cross\_Scope\_Privilege.gif](/files/Rs58xgN7G23sQRMEjOGr)

| Field        | Description                                                                                                                                                            |
| ------------ | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Source Scope | Needs to be set to "Designer" through changing the Application Scope in the beginning.                                                                                 |
| Target Scope | Is either "Global" for the core ServiceNow tables, or the target application scope e.g. "UPM-X".                                                                       |
| Target Name  | The technical table name.                                                                                                                                              |
| Target Table | Should be "Table"                                                                                                                                                      |
| Application  | Needs to be set to "Designer" through changing the Application Scope in the beginning.                                                                                 |
| Operation    | Select "Read" to provide read access for Designer. Select "Create" to provide the rights to create new entries in the selected table through Designers Commit feature. |
| Status       | Set to "Allowed" to provide the necessary rights to the selected operation. Set to "Denied" to block Designer for the selected operation.                              |

4. Click "**Submit**" to create the Cross Scope Privilege.

## Setting Cross Scope Privileges Automatically

To support the automatic creation and management of Cross-Scope Privileges through Class Definitions, please ensure that the Application Access settings (Can Read, Can Create, Can Update, Can Delete) are set correctly on the sys\_db\_object table.

{% hint style="warning" %}
**Extending Rights to third-party apps**

This change will allow any other third-party app to do changes within the Cross Scope Privilege table! You can revoke the changes, once the initial configuration is completed.
{% endhint %}

1. Navigate to the following link:

```
https://YOUR-INSTANCE.service-now.com/now/nav/ui/classic/params/target/sys_db_object.do%3Fsys_id%3Dsys_scope_privilege%26sysparm_refkey%3Dname%26sysparm_domain_restore%3Dfalse%26sysparm_referring_url%3Dsys_scope_privilege_list.do
```

2. Select the "**Application Access**" tab and set the appropriate settings.

![Set-Application-Access.png](/files/CxzTRYXjyeoEFmpHHfCs)

Alternatively, download the following UpdateSet to set the Application Access on your target instance: [Designer-Global-Settings-for-Cross-scope-privilege.xml](https://www.ins-pi.com/hubfs/ins-pi%20Website%20Theme/Knowledgebase/Designer/Designer-Global-Settings-for-Cross-scope-privilege.zip)


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.ins-pi.com/designer/configuration/initial-configuration/class-definitions-and-cross-scope-privileges.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
