Accessing the Templated Script
The Export Saved List to VAN is a templated script that allows users to create or update saved lists of people in VAN. You can access this template in Platform by navigating to “Code” → “More Script Templates” → searching “Export Saved List to VAN” or “30573”. If you are not shared on this template, please email support@civisanalytics.com to request access.
Prior to using this job, please create a custom VAN credential in Platform per this documentation and share the Civis API user on the destination folder in VAN.
Using the Templated Script
The Export Saved List export runs as a templated script within Civis Platform and requires the following parameters:
Cluster (required)
Name of the cluster where data to be exported to NGPVAN is stored.
Queue View or SQL query (required): In order to export a saved list to VAN a table view or SQL query is required in which at least one field is named van_id and contains valid VAN ID values. All other fields will be ignored.
- Queue View: The full table name (including schema) of a Civis table to export as a list. At least one field must be a valid van_id and be labeled van_id.
- SQL Query: A complete SQL query defining the data to export to VAN as a saved list. At least one field must be a valid van_id and be labeled van_id.
Response Table (optional)
Table to output API responses and errors.
Response Table Setting (optional)
Drop or append API records to the response table.
Database Mode (required)
One of MyVoterfile or MyCampaign. The VAN database to upload data.
VAN List ID (optional)
The ID of an existing list in VAN to update. If provided, the existing list will be overwritten. If omitted, a new list will be created, you can find the new list ID in the response table.
VAN List Name (required)
The unique name of a list to create or update in VAN. Note that if list ID is provided the list will be updated and any name change will take affect. If no list ID is provided, and a list exists in VAN with the same name, an error will be returned.
VAN List Description (optional)
An optional description to apply to the saved list.
VAN List Destination Folder (optional)
An optional destination folder ID in which to store the saved list in VAN. If no folder ID is specified the saved list will be stored in the ‘API Generated Lists’ folder in VAN. The folder ID must be shared with the relevant API key.
NGPVAN (required)
A custom Civis credential with the user’s NGPVAN username and password.
Script Mode
The VAN export uses a paradigm of script “modes”, where different methods are executed by running the script in a different mode.
The modes available for the NGP VAN Export script are:
- help - Get help
- test_connection - Test connectivity to NGPVAN API
- list_objects - List export modes available
- run - Run sync (default)
- view_config - Output current configuration as a file output
Log Level
DEBUG - Log details of all API calls.
INFO - Log informational messages about program execution.
WARNING - Log potential errors and other warnings.
ERROR - Logs only unrecoverable errors in program execution.
Comments
0 comments
Please sign in to leave a comment.