Set up a ServiceNow Table Data Source

A ServiceNow Table Data SourceClosed Data sources, also known as "Lookups", are external sources of data that you upload or connect to TrueContext. You can reference this data in a form to populate answers or answer options. Data sources save typing, reduce errors, and make it easy to provide mobile users with only the relevant, most current data. fetches data from records in a ServiceNow Table. You can use this data to define answer options in Dropdown, Radio Button, or Multiselect questions and prefill answers in forms. Field users can choose answers based on values defined by ServiceNow columns. This topic describes how a ServiceNow Table Data Source works and how to set it up.

Available on the Advanced and Enterprise tiers:

Essentials
Advanced
Enterprise

Contents

How a ServiceNow Table Data Source works

A ServiceNow Table Data Source fetches data from records in a ServiceNow Table. You set up the Data Source to fetch values from the columns and records that you specify:

  • Enter Column Names to specify the columns to fetch.

  • Enter a query string to filter the records that the Data Source fetches.

Once the Data Source fetches the data from ServiceNow, you can use that data in your forms. When you add a Dropdown, Radio Button, or Multiselect question, you define the answer options based on the columns in the Data Source. When you dispatch the form, you can prepopulate answers in the form using data from ServiceNow.

How you select the data to fetch

When you configure a ServiceNow Table Data Source, you specify the columns and the records to fetch.

Column Selection

ServiceNow Table Data SourcesClosed Data sources, also known as "Lookups", are external sources of data that you upload or connect to TrueContext. You can reference this data in a form to populate answers or answer options. Data sources save typing, reduce errors, and make it easy to provide mobile users with only the relevant, most current data. fetch data from the columns you specify. By default, the Data Source fetches the Display Value of each column. You can choose to also fetch the column Database Value. The Database Value is crucial when you fully integrate TrueContext and ServiceNow using a Data Destination. This is because ServiceNow uses the Database Value to update fields.

Record filtering

By default, ServiceNow Table Data Sources fetch all the records in a Table. Use Record Filtering to limit the number of records that the Data Source fetches. To do that, you use a query string that you generate in ServiceNow.

Prerequisites to configure a ServiceNow Table Data Source

Steps to configure a ServiceNow Table Data Source

  1. Go to Forms & Integrations > Data Sources > CREATE DATA SOURCE > ServiceNow Table.

    Result: The system opens a new ServiceNow Table Data Source in edit mode.

  2. Enter a Name.

  3. On the Data Retrieval and Format tab, configure how the Data Source fetches data, including the fetch frequency.

  4. On the Connection tab, select an existing ServiceNow Connection or create a new one.

    Tip:If the system doesn’t list the Connection you want to use, make sure it’s available in the same FormSpace.

  5. Enter the Name of the Table from ServiceNow to fetch data from.

  6. Specify the columns you want the Data Source to fetch.

    • Under Column Name, enter the name of your ServiceNow columns as shown in your ServiceNow tables. You must enter at least one column name for the Data Source to fetch.

      Tip:Select Describe ServiceNow Table to open a list of your Table Column Labels and Column Names. Make sure to include the ServiceNow Column Name (not the label) in your Column Selection.

    • Select Include Database Value to fetch the Database Value. The system fetches the Database Value as a separate column.

    The following example shows a Column Selection. The Data Source fetches the Display Value for all entered columns. It also fetches the Database Value for the columns that the user selected. In this case, the user selected the columns that have different Display and Database values.

    Column selection example. Under "Column Name", the user entered the columns to be fetched from ServiceNow. Under "Include Database Value", the user selected the option to also fetch the Database Value for three of the columns.

    Tip:We recommend that you only fetch the Database Value when it’s different from the Display Value.

    The following example shows a CSV export of the data fetched by the Data Source:

    CSV export of a ServiceNow Table Data Source. The column with the heading "asset" includes the Display Value. The column with the heading "asset_dbValue" includes the Database Value.

    The system uses the following format for each column heading:

    • Display Value—ColumnName

    • Database Value—ColumnName_dbValue

    Tip:You can move each Column Name to change the order. The order you choose is the order displayed in the Form Builder and in CSV exports of the Data Source.

  7. Enter a query string to filter the records you want the Data Source to fetch. To generate the query string in ServiceNow:

    1. Navigate to the ServiceNow table that you want to fetch data from.

    2. Select Show / hide filter.

    3. Apply and Run filter rules.

    4. Copy the query string:

      1. Right-click the last filter of the list.

      2. Select Copy query.

      Result: The system copies the query string to your clipboard.

    Info:The ServiceNow Topic Generate an encoded query string through a filter describes how to generate a query string in more detail.

    Once you copy the query string, you paste it in your ServiceNow Table Data Source Record Filtering section. The following example shows a query string from ServiceNow in TrueContext.

    Record filtering with a query string generated in ServiceNow.

  8. Select Create to save your Data Source.

    Tip:You can now use the Data Source to define answer options in Dropdown, Radio Button, or Multiselect questions, and to prefill question answers when you dispatch a form.

Related topics