Poll a Directory Using a Trigger Task from ServiceNow

To make this example work, you must perform the following tasks:
- Create a pipeline that receives specifications from ServiceNow on the file type for which you want to poll a directory.
- Create a Trigger Task that will make the pipeline available as a REST API.
- Create a REST call in ServiceNow that will trigger the Task created in Step 2 above.
Create the File Poller Pipeline
- CSV Parser : Parses the data coming in from ServiceNow as a CSV document.
- Mapper: Makes the contents of the input CSV document available as a parameter.
- File Poller : Polls a specific directory for files matching the pattern specified in the parameter received from the Mapper Snap.
You will note that the File Poller has open input and output views. This is because it receives data from the Trigger Task associated with it and returns processed data back to the same Trigger Task.
CSV Parser : Use the CSV Parser Snap with the default settings:

Mapper: Configure the Mapper Snap to receive the parsed CSV data and map the message in the CSV document to the $msg variable:




You copy the Cloud URL and authorization bearer token, and navigate to ServiceNow to set up the API call.
<Cloud_URL>?bearer_token=<Bearer_Token>
For details on how to set up REST calls using ServiceNow, see ServiceNow documentation.
- HTTP Method is POST.
- Endpoint contains the Cloud URL concatenated with the bearer token.
- HTTP Parameters > Content contains the variable and extension value that you want to use.

Downloads
- Download and import the Pipeline into SnapLogic.
- Configure Snap accounts as applicable.
- Provide Pipeline parameters as applicable.