Skip to main content

Overview

Often you'll need more ways to control the way you call another system and how you deal with the response than are available under the simple data connectors option. In this case you will need to build an advanced data connector. This will allow you to split your communication into multiple steps and give you more scope in how you process the information returned.

Step Types

When building an advanced data connector you can drag the required steps on to the data connector screen and then set the parameters for each step in the same way as you create a process when you build an app. The steps available include:

  • Send HTTP Request - Similar to a simple data connector this allows you to send data to a specified URL.

  • Text Parser - This allows you to parse the results of a request for later use.

  • Template Script - A fixed or dynamic template that can form the body of an HTTP request.

  • Set Variable - This creates a variable and assigns it a value which can be used later in the process.

  • If / Else - Lets you split the process into different branches depending on whether a condition is true or false.

  • XML to JSON - Can be used if the system you are interacting with uses XML to convert to JSON which is the format used by UniFi.

  • Add Security Oauth1 - Authenticates with systems that use Oauth1 security.

  • Generate HMAC - This may be required as part of the authentication process.

Reading Input

Often you may want to pass information to a data connector from the app that is using it. For example, if populating a drop-down list you may want to have the user enter or select an entity which then needs to be used within the request to the source system. Another example might be where you are using data entered into UniFi to create or amend a transaction in another system where you may need to use several of the UniFi fields as part of the body of this request.

UniFi stores any such data in a variable called 'input', which can be read by the data connector and used later to form the request to the other system. The 'input' variable contains the body of the request in JSON format, plus an additional JSON value of 'urlParams' which contains any parameters that may have been passed with the request when the data connector is used in a form control such as a drop-down list. The best way of working with this is to set a variable to contain this information, which you can then refer to at a later stage of the connector. The examples that follow this overview show the various ways of working with the input.

tip

If it is required then reading the input should always be the first step of a data connector