Cinchy Platform Documentation
Cinchy v5.6

Post Sync Scripts

1. Overview

Post sync scripts are written in CQL and can be added to the end of a sync to allow you to do more with your data, such as inserted retrieved values into a Cinchy table.

2. Example Walkthrough

In this example, we will be doing a batch data sync using the Cinchy Table [Product].[Names Test]. In this scenario we will be using the following simple API as our destination:
When we run our batch job, it will check for updates in our source table. These updates will trigger our REST API to fetch our defined value, which we can use in a post-sync script. In this case, our script will insert this value into a second table, [Product].[Response Table].
The following steps will walk you through how to utilize this functionality.
  1. 1.
    Set up your data sync to a REST API as normal. You can review our Source (Image 1), Destination (Image 2), and Sync Behaviour (Image 3) below.
Image 1: Post Sync Scripts
Image 2: Post Sync Scripts
Image 3: Post Sync Scripts
2. Under the Post Sync tab, we want to input the CQL that, in our case, will take the defined variable from our REST API and insert it into the [Product].[Response Test] table (Image 4).
Image 4: Post Sync Scripts
3. Add in your Permissions and click Save.
4. Once we have finished configuring our sync, we can run the job. It will check for new data in our Name column on our [Product].[Names] table (Image 5). When found, it will trigger the REST API to GET our “value” variable. Our post sync script will then take that value and INSERT it into the [Product].[Response Test] table (Image 6).
Image 5: Post Sync Scripts
Imaage 6: Post Sync Scripts