# Connection Variables

{% hint style="info" %}
Although having mutiple environments may not apply to this integration, we will create Connection Variables to contain certain data values which will be substituted into the Poll Processor scripts.
{% endhint %}

Instead of scripting data values directly into the code of your Poll Processor scripts, it may be better practice to use Connection Variables in their place. Not only does it make those scripts cleaner, but it also means that changes in requirements can be more easily enacted by changing the values of the data in those variables, without having to change the code in the scripts.

{% hint style="success" %}
We will use Connection Variables to identify the child Poller and to identify which field elements to return data from when polling.
{% endhint %}

## Icons

{% hint style="info" %}
Before continuing we would like to draw your attention to some of the relevant icons that will be visible down the left hand navigation strip in the Unifi Integration Designer.
{% endhint %}

*The icons are:*

![](https://796541950-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MQBk35gIi557UHt7QlJ%2F-MRQIAkjsRxrWfRO0SHr%2F-MRQSBdjUPd6jugQRw5W%2FV2%20-%20Connection%20Variables%201.png?alt=media\&token=c5f43e7b-ee57-4441-9d1b-9bdf6a7e503f)

a) ***'Integration' icon*****:** Opens the current integration's Details page.

b) ***'Pollers' icon*****:** Opens the current integration's Pollers page.

c) ***'Poll Processors' icon*****:** Opens the current integration's Poll Processors page.

d) **'Connections' icon:** Opens the current integration's Connections page.

## Variable: list\_fields

This variable will contain the minimum set of fields required to identify and select records in the remote system.

To open Unifi Integration Designer, navigate to **\[ws] Unifi > Unifi Integration Designer**, then navigate to **< Your Integration >** *(created following the Outbound Incident Guide)*.

Click the **'Connections' icon**, then navigate to and open **< Your Connection >**.

![](https://796541950-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MQBk35gIi557UHt7QlJ%2F-MRQIAkjsRxrWfRO0SHr%2F-MRQSN6vYnDd5yoFQqQY%2FV2%20-%20Connection%20Variables%202.png?alt=media\&token=56439a7e-d44b-4881-b52f-241432b478d4)

From the Connection, navigate to **Connection > Variables** & click **New**.

The 'list\_fields' New Connection Variable fields to be configured are as follows:

|  #  | Field       | Description                                                              | Value                            |
| :-: | ----------- | ------------------------------------------------------------------------ | -------------------------------- |
|  1  | Key         | A unique name that will be used to get the value.                        | 'list\_fields'                   |
|  2  | Value       | The variable value to be used in the integration.                        | 'sys\_id,number,correlation\_id' |
|  3  | Description | Describe what this connection variable is for and how it should be used. | \<Your Description>              |

*Your 'list\_fields' New Connection Variable modal should look like this:*

![](https://796541950-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MQBk35gIi557UHt7QlJ%2F-MRQIAkjsRxrWfRO0SHr%2F-MRQSbdQ-0uHcwZGxEOY%2FV2%20-%20Connection%20Variables%203.png?alt=media\&token=1fefd831-9229-4e04-b58b-b42cf085bae2)

4\) Click **Submit**.

You will be redirected back to the Variables page of the Connection record.

## Variable: child\_fields

This variable will contain all the fields which will be retrieved from the remote system by the child Poller.

Click **New**.

The 'child\_fields' New Connection Variable fields to be configured are as follows:

|  #  | Field       | Description                                                              | Value                                                                                                                               |
| :-: | ----------- | ------------------------------------------------------------------------ | ----------------------------------------------------------------------------------------------------------------------------------- |
|  5  | Key         | A unique name that will be used to get the value.                        | 'child\_fields'                                                                                                                     |
|  6  | Value       | The variable value to be used in the integration.                        | 'sys\_id,number,correlation\_id,short\_description,description, state,close\_code,close\_notes,sys\_updated\_on,sys\_updated\_by'\* |
|  7  | Description | Describe what this connection variable is for and how it should be used. | \<Your Description>                                                                                                                 |

{% hint style="info" %}
\*The comma-separated list of fields **with no spaces**. *(We have included a space for display purposes only - to make the list appear over two lines.)*
{% endhint %}

*Your 'child\_fields' New Connection Variable modal should look like this:*

![](https://796541950-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MQBk35gIi557UHt7QlJ%2F-MRQIAkjsRxrWfRO0SHr%2F-MRQTz0drAlJUTs4GcXH%2FV2%20-%20Connection%20Variables%204.png?alt=media\&token=9e158ab9-02af-4d88-9197-7dfde38fdc5d)

8\) Click **Submit**.

You will be redirected back to the Variables page of the Connection record.

## Variable: incident\_poller

This variable will contain the sys\_id of the child Poller which we will create on the '[Child Poller](https://docs.sharelogic.com/unifi/2.2/integration-guides/incident-parent-and-child-poller-guide/child-poller#new-poller)' page of this Guide. Once you have created the Poller, copy the sys\_id and paste it as the value in this variable.

The 'incident\_poller' New Connection Variable fields to be configured are as follows:

|  #  | Field       | Description                                                              | Value               |
| :-: | ----------- | ------------------------------------------------------------------------ | ------------------- |
|  9  | Key         | A unique name that will be used to get the value.                        | 'incident\_poller'  |
|  10 | Value       | The variable value to be used in the integration.                        | \<Your Value>\*     |
|  11 | Description | Describe what this connection variable is for and how it should be used. | \<Your Description> |

{% hint style="info" %}
*\*Value may vary. Use the sys\_id of the Poller you will create from the 'Child Poller' page.*
{% endhint %}

*Your 'incident\_poller' New Connection Variable modal should look like this:*

![](https://796541950-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MQBk35gIi557UHt7QlJ%2F-MRQIAkjsRxrWfRO0SHr%2F-MRQVvcfydN5DRKBed1g%2FV2%20-%20Connection%20Variables%205.png?alt=media\&token=98d52b87-8e4a-4ae3-a252-92f948e7df3a)

12\) Click **Submit**.

*The following Connection Variables should now be in place for your Connection:*

![](https://796541950-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MQBk35gIi557UHt7QlJ%2F-MRQIAkjsRxrWfRO0SHr%2F-MRQW4zGPhFAgropO6oM%2FV2%20-%20Connection%20Variables%206.png?alt=media\&token=cfe859ee-5bff-46d4-bcd1-26877f18ffd4)

Now let's move on and configure the **Child Poll Processor**.
