> For the complete documentation index, see [llms.txt](https://docs.coupler.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.coupler.io/sources/category/finance-and-accounting/xero/how-to-use-where-filter-in-xero.md).

# How to use Where filter in Xero

To filter data that you fetch from **Xero,** you can use the **Where** parameter:

<figure><img src="https://1055512216-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FOFxU2LUkJMCfvbE2re5C%2Fuploads%2FMLVsPeVvTNQJmtrpGJz5%2Fimage.png?alt=media&amp;token=6b6fdd9d-f321-4396-8a9e-cafc8bb2a6d9" alt=""><figcaption></figcaption></figure>

With the **Where** parameter, it's possible to, for example, fetch only Invoices with an amount higher than a certain number, updated after a specific date, etc. To use the **Where** parameter correctly, please check the following materials:

1. [What is the syntax of the Where parameter?](#the-syntax-for-the-where-parameter)
2. [Specific of Where parameter usage for different data types.](#examples-of-where-parameter-usage-for-different-data-types)
3. [List of fields per Xero data entity with their data type.](#list-of-fields-per-xero-data-entity-with-their-data-type-supported-in-where-parameter)

#### The syntax for the Where parameter

The structure for the Where parameter is as follows:

```
<<Name of the data entity parameter>> + <<Operator>> + <<Value to compare with>>
```

The simplest example:

```
Total = 20.00
```

<figure><img src="https://1055512216-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FOFxU2LUkJMCfvbE2re5C%2Fuploads%2FSkRR6jNtR9wmcklsPunl%2Fimage.png?alt=media&amp;token=336fa70b-03f4-4585-a869-232d58459e91" alt=""><figcaption></figcaption></figure>

In this example:

* **Total** - the name of the data entity field
* **=** - operator
* **20.00** - value to compare with

Available **operators** for each data type are different:

| **Data type**                                                       | **Allowed operators**                                                                  |
| ------------------------------------------------------------------- | -------------------------------------------------------------------------------------- |
| String                                                              | <p>==</p><p>.Contains("value")</p><p>.StartsWith("value")</p><p>.EndsWith("value")</p> |
| GUID                                                                | =GUID("value")                                                                         |
| Number                                                              | =, >, <, >=, <=, !=                                                                    |
| Date                                                                | =, >, <, >=, <=, !=                                                                    |
| Boolean                                                             | ==                                                                                     |
| <p>Data with predefined</p><p>set of values (i.e. Type, Status)</p> | <p>==</p><p>!=</p>                                                                     |

**It is possible to use several conditions in the Where parameter:**

To fetch results that correspond to both conditions - use AND / &&:

```
Type=="ACCPAY" && AmountDue > 0
```

To fetch results that correspond to one of the conditions - use OR / ||:

```
TaxType == "TAX001" OR TaxType == "TAX002"
Type == "ACCPAY" || Type == "ACCREC"
```

#### Examples of Where parameter usage for different data types

Parameters with **GUID** type:

```
AccountID = GUID("CEEF66A5-A545-413B-9312-78A545AADBC4")
```

Parameters with **String** type.

It is possible to filter data by **exact value**, data that **contains** some value, data **starts** from some value, data **ends** with some value:

```
Name=="Checking Account"
Name.Contains("Account")
Name.StartsWith("Account")
Name.EndsWith("Account")
```

**Note**: Check for not null value can be required for optional String parameters - i.e. *BankAccountNumber*

```
BankAccountNumber=="132435465"
BankAccountNumber != null AND BankAccountNumber.Contains("132435465")
BankAccountNumber != null AND BankAccountNumber.StartsWith("1")
BankAccountNumber != null AND BankAccountNumber.EndsWith("1")
```

Parameters with **Number** type.

It is possible to filter data if it **equals** some value, **less**, **more**, **less\&equals,** **more\&equals** or not **equals**:

```
Total = 20.00
Total < 20.00
Total > 20.00
Total <= 20.00
Total >= 20.00
Total != 20.00
```

Parameters with a **Date** type.

It is possible to filter data using dates and next comparison: **equal**, **before**/**after** (including or excluding the date), **not equal**:

```
Date = DateTime(2022, 01, 30)
Date > DateTime(2022, 01, 01)
Date >= DateTime(2022, 01, 01)
Date < DateTime(2022, 01, 01)
Date <= DateTime(2022, 01, 01)
Date != DateTime(2022, 01, 01)
```

Parameters with **Boolean** type:

```
ShowInExpenseClaims == TRUE
EnablePaymentsToAccount == FALSE
```

Parameters with types that have a **predefined set of values** (i.e. Account Type, Account Status, Tax Type):

```
TaxType == "TAX001"
Type != "SPEND"
```

#### List of fields per Xero data entity with their data type (supported in Where parameter)

#### Accounts

It is possible to use the next parameters in the **Where** field:

| **Parameters**                                                                                              | **Type**                                                                                       |
| ----------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------- |
| AccountID                                                                                                   | GUID                                                                                           |
| <p>Code, Name, BankAccountNumber</p><p>Description, CurrencyCode, ReportingCode</p><p>ReportingCodeName</p> | String                                                                                         |
| Type                                                                                                        | [Account Type](https://developer.xero.com/documentation/api/accounting/types/#accounts)        |
| Status                                                                                                      | [Account Status](https://developer.xero.com/documentation/api/accounting/types/#accounts)      |
| BankAccountType                                                                                             | [Bank Account type](https://developer.xero.com/documentation/api/accounting/types/#accounts)   |
| TaxType                                                                                                     | [Tax Type](https://developer.xero.com/documentation/api/accounting/types/#tax-rates)           |
| <p>EnablePaymentsToAccount</p><p>ShowInExpenseClaims</p><p>HasAttachments</p><p>AddToWatchlist</p>          | Boolean                                                                                        |
| Class                                                                                                       | [Account Class Types](https://developer.xero.com/documentation/api/accounting/types/#accounts) |
| UpdatedDateUTC                                                                                              | Date                                                                                           |

#### Bank Transactions

It is possible to use the next parameters in the **Where** field:

| **Parameters**                                                                                                      | **Type**                                                                                                         |
| ------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------- |
| <p>BankTransactionID</p><p>PrepaymentID</p><p>OverpaymentID</p><p>BankAccount.AccountID</p><p>Contact.ContactID</p> | GUID                                                                                                             |
| Type                                                                                                                | [Bank Transaction Type](https://developer.xero.com/documentation/api/accounting/types/#bank-transactions)        |
| <p>IsReconciled</p><p>HasAttachments</p>                                                                            | Boolean                                                                                                          |
| DateString                                                                                                          | Date                                                                                                             |
| <p>CurrencyCode</p><p>CurrencyRate</p><p>Url</p><p>BankAccount.Code</p><p>BankAccount.Name</p><p>Contact.Name</p>   | String                                                                                                           |
| Status                                                                                                              | [Bank Transaction Status Code](https://developer.xero.com/documentation/api/accounting/types/#bank-transactions) |
| LineAmountTypes                                                                                                     | [Line Amount Type](https://developer.xero.com/documentation/api/accounting/types/#invoices)                      |
| SubTotal, TotalTax, Total                                                                                           | Number                                                                                                           |
| <p><br></p>                                                                                                         | <p><br></p>                                                                                                      |

#### Bank Transfers

Xero API allows filtering of Bank Transfers by any parameter. See [Bank Transfer](https://developer.xero.com/documentation/api/accounting/banktransfers#get-banktransfers) Xero documentation.

#### Branding Themes

The **Where** parameter is not supported.

#### Contact Groups

Xero API allows filtering of Contact Groups by any parameter. See [Contact Groups](https://developer.xero.com/documentation/api/accounting/contactgroups) Xero documentation.

#### Contacts

Xero documentation recommends **limiting** filtering to **optimized** parameters only:

| **Parameters**                                     | **Type** |
| -------------------------------------------------- | -------- |
| ContactID                                          | GUID     |
| <p>ContactNumber</p><p>Name</p><p>EmailAddress</p> | String   |

#### Credit Notes

Xero API allows the filtering of Credit Notes by any parameter. See [Credit Notes](https://developer.xero.com/documentation/api/accounting/creditnotes#get-creditnotes) Xero documentation.

#### Currencies

Xero API allows the filtering of Currencies by any parameter. See [Currencies ](https://developer.xero.com/documentation/api/accounting/currencies)Xero documentation.

#### Employees

Xero API allows the filtering of Employees by any parameter. See [Employees ](https://developer.xero.com/documentation/api/accounting/employees)Xero documentation.

#### Expense Claims

Xero API allows filtering of Expense Claims by any parameter. See [Expense Claims](https://developer.xero.com/documentation/api/accounting/expenseclaims#overview) Xero documentation.

#### Invoices

Xero documentation recommends limiting filtering to **optimized** parameters only:

| **Parameters**                           | **Type**                                                                                                     |
| ---------------------------------------- | ------------------------------------------------------------------------------------------------------------ |
| <p>InvoiceID</p><p>Contact.ContactID</p> | GUID                                                                                                         |
| InvoiceNumber                            | Number                                                                                                       |
| Status                                   | [Invoice Status Code](https://developer.xero.com/documentation/api/accounting/invoices#invoice-status-codes) |
| <p>Contact.Name</p><p>Reference</p>      | String                                                                                                       |
| Date                                     | Date                                                                                                         |
| Type                                     | [Invoice Type](https://developer.xero.com/documentation/api/accounting/types#invoices)                       |

#### Items

Xero API allows the filtering of Items by any parameter. See [Items ](https://developer.xero.com/documentation/api/accounting/items#get-items)Xero documentation.

#### Journals

Journals Data Entity has no "Where" parameter in settings. However, it has 2 specific fields that allow fetching journals filtered by JournalNumber:

* *Journal number more than*
* *Journal number less than*

#### Linked Transactions

The **Where** parameter is not supported.

#### Manual Journals

Xero API allows the filtering of Manual Journals by any parameter. See [Manual Journals](https://developer.xero.com/documentation/api/accounting/manualjournals#overview) Xero documentation.

{% hint style="info" icon="lightbulb" %}
*Note on JournalLines fields*

When you filter by a field inside `JournalLines` (for example `JournalLines.AccountCode == 310`), Xero returns each matching Manual Journal as a single row that includes **all** of its journal lines - not just the one that matched your filter. If you need each journal line as its own row (e.g. to see only the line with `AccountCode = 310`), enable **Split by Journal Lines** on the Sources step before applying filters in the Data Sets step.
{% endhint %}

#### Organisation

The **Where** parameter is not supported.

#### Overpayments

Xero API allows the filtering of Overpayments by any parameter. See [Overpayments ](https://developer.xero.com/documentation/api/accounting/overpayments#get-overpayments)Xero documentation.

#### Payments

Xero API allows the filtering of Payments by any parameter, but defines a list of optimized parameters:

| **Parameters**                           | **Type**                                                                                     |
| ---------------------------------------- | -------------------------------------------------------------------------------------------- |
| <p>PaymentId</p><p>Invoice.InvoiceId</p> | GUID                                                                                         |
| PaymentType                              | [Payment Type](https://developer.xero.com/documentation/api/accounting/types#PaymentTypes)   |
| Status                                   | [Status](https://developer.xero.com/documentation/api/accounting/types#payment-status-codes) |
| Date                                     | Date                                                                                         |
| Reference                                | String                                                                                       |

#### Prepayments

Xero API allows filtering of Prepayments by any parameter. See [Prepayments ](https://developer.xero.com/documentation/api/accounting/prepayments#get-prepayments)Xero documentation.

#### Purchase Orders

*The **Where** parameter is not supported.*

#### Receipts

Xero API allows the filtering of Receipts by any parameter. See [Receipts ](https://developer.xero.com/documentation/api/accounting/receipts#get-receipts)Xero documentation.

#### Repeating Invoices

Xero API allows the filtering of Repeating Invoices by any parameter. See [Repeating Invoices](https://developer.xero.com/documentation/api/accounting/repeatinginvoices#get-repeatinginvoices) Xero documentation.

#### Tax Rates

Xero API allows the filtering of Tax Rates by any parameter. See [Tax Rates](https://developer.xero.com/documentation/api/accounting/taxrates#get-taxrates) Xero documentation.

#### Tracking Categories

Xero API allows the filtering of Tracking Categories by any parameter. See [Tracking Categories](https://developer.xero.com/documentation/api/accounting/trackingcategories#overview) Xero documentation.

#### Users

| **Parameters**                                     | **Type**                                                                              |
| -------------------------------------------------- | ------------------------------------------------------------------------------------- |
| UserID                                             | GUID                                                                                  |
| <p>EmailAddress</p><p>FirstName</p><p>LastName</p> | String                                                                                |
| IsSubscriber                                       | Boolean                                                                               |
| OrganisationRole                                   | [User role](https://developer.xero.com/documentation/api/accounting/types#user-roles) |
| UpdatedDateUTC                                     | Date                                                                                  |

> ***If you can't find the case that you need or have any issues with syntax, please write to our support team!***
>
> *If you find discrapency in the documentation, please reach out to our support team as well - we'll quickly update it.*
>
> *Meantime, check* [*Xero documentation*](https://developer.xero.com/documentation/api/accounting/accounts#get-accounts) *for the latest information.*


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

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

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.coupler.io/sources/category/finance-and-accounting/xero/how-to-use-where-filter-in-xero.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

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.
