# Data Types

### Merge Fields and Data Types

UbiQuity uses the standard data types:

* String
* Integer and Real Number
* Yes or No (Boolean)

It is helpful to have a basic understanding between what these are in order to be able to use them correctly in ESL.

Different data types allow you to use different operators, and some data types require the values to be wrapped in quotes.

For example, you can use the "greater than" operator for number field types, but it doesn't make sense to use this for an email address (string) field type.

### String

A String is a series of either letters, numbers, symbols, spaces or a combination of these. If you are not sure of what the exact value is going to be, or your internal ID's have letters in them, use this data type.

Fields that are strings in the UbiQuity database are:

* Text
* Notes
* Email Address
* Mobile Number
* Date
* Time
* Date and Time
* GUID

Apart from Text and Notes fields, all the other field types have validation to stop a non-valid value being placed inside, but at heart they are still a string of characters.

A String data type will always require quote marks (" ") surrounding them when used in logic.

```
{{ If ([Database.First Name] eq "John") }}
```

When merging you can use [date formatters](/documentation/keep-learning/esl-ubiquitys-scripting-language/merge-field-formatters.md#format-dates) or [mobile number formatters](/documentation/keep-learning/esl-ubiquitys-scripting-language/merge-field-formatters.md#format-mobile-numbers) to control how the output displays.

### Integer and Real Number

An Integer is a whole number. It cannot contain decimals, and can only store a number with less than 11 characters. In UbiQuity databases this is known as a "Whole Number" field.

A Real Number is a set of numbers, and these can contain numbers with decimal points. In UbiQuity databases this is known as a "Decimal Number" field.

Integers and Real Numbers can only contain numbers: no spaces, letters or symbols are allowed.

An Integer or Real Number data-type does not need to be wrapped in quotes when used in ESL.

```
{{ If ([Database.Id] eq 1022202) }}
```

If a merge field is one of these number types you can format the output using [number formatters](/documentation/keep-learning/esl-ubiquitys-scripting-language/merge-field-formatters.md#format-numbers).

### Yes or No (Boolean)

A Yes or No field is either True or False. We call this as Yes or No field in the UbiQuity database as it is easier to understand. Developers will know it as a Boolean.

You can optionally wrap these values in quotes.

```
{{ If([Database.Registered] eq true }}
{{ If([Database.Registered] eq "false" }}
```

<br>


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.ubiquity.co.nz/documentation/keep-learning/esl-ubiquitys-scripting-language/data-types.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
