Connections Functions

1. Overview

The set of functions listed in this page are for use in Cinchy's Connections Experience when configuring data syncs.

JSON_ESCAPE

This function is used in Connections to escape parameter values and be safe to use inside a JSON document without breaking it

This function can be used in a REST API connection anywhere that allows parameters to be, such as the URL endpoint, the Request Body, or a Post-Sync Script.

Syntax

JSON_ESCAPE(@Parameter)

Arguments

ArgumentDescription

Parameter

The parameter value that you want to escape in order to be safe to use inside a JSON document without breaking it

Example 1

The following example shows how you would use JSON_ESCAPE in your REST API URL (Image 1).

In this example we have an API and want to add a value (@Parameter) that contains double quotes -- this could break the JSON structure, so we need to wrap the parameter with JSON_ESCAPE().

Example 2

The following example shows how you would use JSON_ESCAPE in your REST API Request Body (Image 2).

In this example we have an API and want to add a value (@Parameter) that contains double quotes -- this could break the JSON structure, so we need to wrap the parameter with JSON_ESCAPE().

URL_ESCAPE

This function is used in Connections to escape parameter values and be safe to use inside a URL without breaking it

This function can be used in a REST API connection anywhere that allows parameters to be, such as the URL endpoint, the Request Body, or a Post-Sync Script.

Syntax

 URL_ESCAPE(@Parameter)

Arguments

ArgumentDescription

Parameter

The parameter value that you want to escape in order to be safe to use inside a URL without breaking it

Example 1

The following example shows how you would use URL_ESCAPE in your REST API URL (Image 3).

In this example we have an API and want to add a value (@Parameter) that contains the "&" symbol to the URL field. To properly read the URL, we need to wrap the parameter with URL_ESCAPE(), which will escape the & to be %26.

STRING_ESCAPE()

The STRING_ESCAPE() function escapes single quotes in data sync parameters by adding two single quotes. It can be used to wrap around parameters or column references respectively. This can be useful when you use it in a post sync script's CQL.

Syntax

STRING_ESCAPE(@yourparameter)

Or

STRING_ESCAPE(@COLUMN('yourcolumn'))

Example

STRING_ESCAPE(This is my data sync's test)

will become

This is my data sync''s test

Last updated