// This module is included in the following assemblies:
// as_connecting-to-servicenow.adoc

[id='add-servicenow-connection-start_{context}']
= Obtaining records from ServiceNow to trigger integration execution

To trigger execution of an integration upon receiving records from ServiceNow,
add a ServiceNow connection to a simple integration as its start connection.

.Prerequisites
* You created a ServiceNow connection. 
* You know the name of the table that you want to retrieve
records from. 
* You should have already defined a ServiceNow query that obtains
only the records that you want.
You can find information about ServiceNow queries here:
https://docs.servicenow.com/bundle/jakarta-platform-user-interface/page/use/using-lists/concept/c_EncodedQueryStrings.html[ServiceNow encoded queries]. 

.Procedure

. In the {prodname} panel on the left, click *Integrations*.
. Click *Create Integration*.
. On the *Choose a connection* page, click the ServiceNow connection that
you want to use to start the integration.
. On the *Choose an action* page, select *Retrieve Record* to
obtain records from a ServiceNow table that you select. 
. Configure the *Retrieve Record* action: 

.. Click in the *Table name* field and select the table that you want
to obtain records from. 
.. In the *Query to filter the result set* field, enter a ServiceNow
query. For example, consider the `state=1^impact=2` query on a table
that keeps records about incidents. This query returns records for  new
incidents (`state=1`) that have a medium impact (`impact=2`). 
If you do not enter a query and the records in the table do not change,  
the connection obtains the same records every time. 
.. In the *Limit of elements per page* field, enter the maximum number of
records that you want the connection to obtain. In this release, 
you must enter a value, the recommendation is to enter `1000` or less, 
and pagination is not supported. 
.. In the *Period* field, indicate how often you want to obtain records.
The default is every minute. In other words, by default, {prodname} executes this
integration every 60 seconds. 
.. Click *Next*. 

.Results

{prodname} generates a JSON schema that defines the structure of the
obtained records. This enables you to add a data mapping step before the next
connection in the integration if data mapping is needed. 

{prodname} prompts you to choose a finish connection. 
