Skip to content

Retain connectors

Retain connectors provide a core functionality that can be reused in other Logic Apps. They allow you to interact with Retain cloud apps in an easier way without going down the api route. They are used as building blocks and are triggered by an http action.

This following Retain connectors can be used:

Install Retain connectors

In order to use Retain connectors, you will have to install them in your environment. This can be done by deploying the following template: logiccc-integrations-template.json (download).

Note: The template should be deployed only once per resource group/subscription to avoid duplicates.

Find Retain connectors

  1. Select a Logic App and then select Logic app designer and New Step
  2. Select Custom
  3. Select a Retain connector to use from the list

GetBearerToken

Fetches an authorisation token based on the username and the password for Retain Cloud.

Input:

User email and password credentials for Retain Cloud for the specified tenant and environment.

Output:

Bearer token that can be used in other custom connectors.

Transform And Upsert

Transforms the source JSON using the passed mapping rules. These mapping rules are used to map external field identifiers from the source JSON to Retain field identifiers. After transforming the source, it performs either an upsert (insert/update) or delete operation based on the "OperationType" param in the the map data JSON.

Input:

  • Access token: bearer token which can be obtained by using GetBearerToken connector
  • Input source: a JSON array containing the source data that is to be converted and imported to Retain Cloud
  • Map data: a JSON object containing "OperationType" ("upsert" or "delete") and "FieldMaps" field mapping information

Sample input source

[{
    "BKG_REFERENCE_CODE": "BKG001",
    "BKG_START_DATE": "2022-08-15T00:00:00Z",
    "BKG_END_DATE": "2022-08-17T00:00:00Z",
    "BKG_RES_EMP_CODE": "RES007",
    "BKG_JOB_REFERENCE_CODE": "JOB003"
},{
    "BKG_REFERENCE_CODE": "BKG002",
    "BKG_START_DATE": "2022-08-18T00:00:00Z",
    "BKG_END_DATE": "2022-08-19T00:00:00Z",
    "BKG_RES_EMP_CODE": "RES007",
    "BKG_JOB_REFERENCE_CODE": "JOB004"
}]

Sample map data

{
    "OperationType": "upsert",
    "FieldMaps": [
        {
            "SourceField": "BKG_REFERENCE_CODE",
            "DestinationField": "booking_custom_externalId"
        },
        {
            "SourceField": "BKG_REFERENCE_CODE",
            "DestinationField": "booking_guid",
            "LookupLinkField": "booking_custom_externalId"
        },
        {
            "SourceField": "BKG_START_DATE",
            "DestinationField": "booking_start"
        },
        {
            "SourceField": "BKG_END_DATE",
            "DestinationField": "booking_end"
        },
        {
            "SourceField": "BKG_RES_EMP_CODE",
            "DestinationField": "booking_resource_guid",
            "LookupLinkField": "resource_staffno"
        },
        {
            "SourceField": "BKG_JOB_REFERENCE_CODE",
            "DestinationField": "booking_job_guid",
            "LookupLinkField": "job_code"
        }
    ]
}

Output:

Array with a JSON object containing the imported data and the result of the operation.

Fetch data

Fetches data based on the filter criteria provided using the query tables API. However, the Query tables API is restricted to maximum 1k records returned, whereas this endpoint bypasses that restriction and fetches all records that satisfy the passed filter. This may make it slower, depending on the specific system & query.

Input:

  • Access token: bearer token which can be obtained by using GetBearerToken connector
  • Table: name of the table from which data is fetched
  • Filter payload: should be in the same format as query tables API.

Output:

Returns JSON array of records which match the filter.

Convert CSV to JSON

Allows you to convert CSV data into JSON.

Input:

  • CSV data: input data in CSV format
  • Access code: access key granting access to the underlying Azure Function. Contact our delivery team if you need help with this
  • Stringify: true or false. When set to true, all values are converted to string in the output

Output:

JSON array with records converted into JSON objects.