title | description | author | ms.author | ms.reviewer | ms.date | ms.topic | ms.subservice | search.audienceType | contributors | ||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
condition operator values |
Use these values in a condition element operator attribute to specify how to evaluate the condition. |
pnghub |
gned |
jdaly |
03/08/2024 |
reference |
dataverse-developer |
|
|
To learn how to use these values, see Filter rows using FetchXml.
This section groups operators by the type of data they can be used with.
- Choice data
- Datetime data
- Hierarchical data
- Number data
- Owner data
- String data
- Unique Identifier data
Use the following operators in conditions using choice values.
Operator | Description |
---|---|
contain-values | [!INCLUDE operator-contain-values-description] |
eq | [!INCLUDE operator-eq-description] |
in | [!INCLUDE operator-in-description] |
ne | [!INCLUDE operator-ne-description] |
not-contain-values | [!INCLUDE operator-not-contain-values-description] |
not-null | [!INCLUDE operator-not-null-description] |
null | [!INCLUDE operator-null-description] |
Use the following operators in conditions using date and time values.
Note
When a column is configured with DateOnly
behavior you cannot use the operators that apply to hours and minutes. Learn more about the behavior of date and time columns.
The behavior of some operators depend on the fiscal year settings for the environment. Learn more about fiscal year settings
Use the following operators in conditions using hierarchical data. Learn more about querying hierarchical data.
Operator | Description |
---|---|
above | [!INCLUDE operator-above-description] |
eq-or-above | [!INCLUDE operator-eq-or-above-description] |
eq-or-under | [!INCLUDE operator-eq-or-under-description] |
eq-useroruserhierarchy | [!INCLUDE operator-eq-useroruserhierarchy-description] |
eq-useroruserhierarchyandteams | [!INCLUDE operator-eq-useroruserhierarchyandteams-description] |
not-under | [!INCLUDE operator-not-under-description] |
under | [!INCLUDE operator-under-description] |
Use the following operators in conditions using numeric values.
Operator | Description |
---|---|
between | [!INCLUDE operator-between-description] |
eq-userlanguage | [!INCLUDE operator-eq-userlanguage-description] |
eq | [!INCLUDE operator-eq-description] |
ge | [!INCLUDE operator-ge-description] |
gt | [!INCLUDE operator-gt-description] |
in | [!INCLUDE operator-in-description] |
le | [!INCLUDE operator-le-description] |
lt | [!INCLUDE operator-lt-description] |
ne | [!INCLUDE operator-ne-description] |
not-between | [!INCLUDE operator-not-between-description] |
not-in | [!INCLUDE operator-not-in-description] |
not-null | [!INCLUDE operator-not-null-description] |
null | [!INCLUDE operator-null-description] |
Use the following operators in conditions using owner values.
Operator | Description |
---|---|
eq-useroruserteams | [!INCLUDE operator-eq-useroruserteams-description] |
eq-userteams | [!INCLUDE operator-eq-userteams-description] |
eq | [!INCLUDE operator-eq-description] |
in | [!INCLUDE operator-in-description] |
ne | [!INCLUDE operator-ne-description] |
Use the following operators in conditions using string values.
All filter conditions for string values are case insensitive.
You can use wildcard characters for the following operators: like, not-like, begins-with, not-begin-with, ends-with, and not-end-with. Learn more about using wildcard characters in conditions for string values
Operator | Description |
---|---|
begins-with | [!INCLUDE operator-begins-with-description] |
ends-with | [!INCLUDE operator-ends-with-description] |
eq | [!INCLUDE operator-eq-description] |
ge | [!INCLUDE operator-ge-description] |
gt | [!INCLUDE operator-gt-description] |
in | [!INCLUDE operator-in-description] |
le | [!INCLUDE operator-le-description] |
like | [!INCLUDE operator-like-description] |
lt | [!INCLUDE operator-lt-description] |
ne | [!INCLUDE operator-ne-description] |
not-begin-with | [!INCLUDE operator-not-begin-with-description] |
not-end-with | [!INCLUDE operator-not-end-with-description] |
not-like | [!INCLUDE operator-not-like-description] |
not-null | [!INCLUDE operator-not-null-description] |
null | [!INCLUDE operator-null-description] |
Use the following operators in conditions using unique identifier (GUID) values.
Operator | Description |
---|---|
eq-businessid | [!INCLUDE operator-eq-businessid-description] |
eq-userid | [!INCLUDE operator-eq-userid-description] |
eq | [!INCLUDE operator-eq-description] |
in | [!INCLUDE operator-in-description] |
ne-businessid | [!INCLUDE operator-ne-businessid-description] |
ne-userid | [!INCLUDE operator-ne-userid-description] |
ne | [!INCLUDE operator-ne-description] |
not-null | [!INCLUDE operator-not-null-description] |
null | [!INCLUDE operator-null-description] |
This section includes details about each of the FetchXml condition operators.
[!INCLUDE operator-above-description]
Learn more about querying hierarchical data
Data Type: Hierarchical
[!INCLUDE operator-begins-with-description]
[!INCLUDE wildcard-string-operator]
Data Type: String
[!INCLUDE operator-between-description]
This operator requires two values.
<condition attribute="numberofemployees" operator="between">
<value>6</value>
<value>20</value>
</condition>
Data Types:
[!INCLUDE operator-contain-values-description]
Data Type: Choice
[!INCLUDE operator-ends-with-description]
[!INCLUDE wildcard-string-operator]
Data Type: String
[!INCLUDE operator-eq-description]
Data Types:
[!INCLUDE operator-eq-businessid-description]
Data Type: Unique Identifier
[!INCLUDE operator-eq-or-above-description]
Learn more about querying hierarchical data
Data Type: Hierarchical
[!INCLUDE operator-eq-or-under-description]
Learn more about querying hierarchical data
Data Type: Hierarchical
[!INCLUDE operator-eq-userid-description]
No value is required for this operator.
<condition attribute='ownerid' operator='eq-userid' />
Data Type: Unique Identifier
[!INCLUDE operator-eq-userlanguage-description]
When a column uses the Power Apps Language type, it is an integer value that stores the Microsoft Locale ID Value for the language. The value is compared to the UserSettings.UILanguageId that represents the calling user's preferred language. These columns have AttributeMetadata.AttributeTypeName.Value equal to IntegerType and a Format value of IntegerFormat.Language.
Data Type: Number
[!INCLUDE operator-eq-useroruserhierarchy-description]
Learn more about querying hierarchical data
Data Type: Hierarchical
[!INCLUDE operator-eq-useroruserhierarchyandteams-description]
Learn more about querying hierarchical data
Data Type: Hierarchical
[!INCLUDE operator-eq-useroruserteams-description]
Data Type: Owner
[!INCLUDE operator-eq-userteams-description]
Data Type: Owner
[!INCLUDE operator-ge-description]
Data Types:
[!INCLUDE operator-gt-description]
Data Types:
[!INCLUDE operator-in-description]
Data Types:
- Choice
- Number
- Unique Identifier
- Owner
- String Up to 850 characters
[!INCLUDE operator-in-fiscal-period-description]
Learn more about fiscal year settings
The following example shows a FetchXML query that finds all orders fulfilled in period three of any fiscal year, according to the organization's fiscal year settings. The fiscal period value is specified in the value column of the condition element. If the organization uses fiscal months, the query returns results from month three. If the organization uses fiscal quarters, the query returns results from quarter three. If the organization uses fiscal semesters, no results are returned; there are only two semesters, and the value supplied is therefore out of range.
<fetch>
<entity name="order">
<attribute name="name" />
<filter type="and">
<condition attribute="datefulfilled"
operator="in-fiscal-period"
value="3" />
</filter>
</entity>
</fetch>
Data Type: Datetime
[!INCLUDE operator-in-fiscal-period-and-year-description]
Learn more about fiscal year settings
The following example shows a FetchXML expression that finds all orders fulfilled in period three of fiscal year 2023, according to the organization's fiscal year settings. If the organization uses fiscal months, the query returns results from month three. If the organization uses fiscal quarters, the query returns results from quarter three. If the organization uses fiscal semesters, no results are returned; there are only two semesters, and the value supplied is therefore out-of-range
<fetch>
<entity name="order">
<attribute name="name" />
<filter type="and">
<condition attribute="datefulfilled"
operator="in-fiscal-period-and-year">
<value>3</value>
<value>2023</value>
</condition>
</filter>
</entity>
</fetch>
Data Type: Datetime
[!INCLUDE operator-in-fiscal-year-description]
Learn more about fiscal year settings
The following example shows a FetchXML expression that finds all accounts created in fiscal year 2023.
<fetch>
<entity name="account">
<attribute name="name" />
<filter type="and">
<condition attribute="createdon"
operator="in-fiscal-year"
value="2023" />
</filter>
</entity>
</fetch>
Data Type: Datetime
[!INCLUDE operator-in-or-after-fiscal-period-and-year-description]
Learn more about fiscal year settings
Data Type: Datetime
[!INCLUDE operator-in-or-before-fiscal-period-and-year-description]
Learn more about fiscal year settings
Data Type: Datetime
[!INCLUDE operator-last-fiscal-period-description]
Learn more about fiscal year settings
The following example shows a FetchXML expression that finds all orders fulfilled in the last fiscal period, according to the organization's fiscal year settings. For example, if the organization uses fiscal months, the query returns orders fulfilled in the last fiscal month. If the organization uses fiscal quarters, the query returns orders fulfilled in the last fiscal quarter. If the organization uses fiscal semesters, orders fulfilled in the last fiscal semester are returned.
<fetch>
<entity name="order">
<attribute name="name" />
<filter type="and">
<condition attribute="datefulfilled"
operator="last-fiscal-period" />
</filter>
</entity>
</fetch>
Data Type: Datetime
[!INCLUDE operator-last-fiscal-year-description]
Learn more about fiscal year settings
Data Type: Datetime
[!INCLUDE operator-last-month-description]
Data Type: Datetime
[!INCLUDE operator-last-seven-days-description]
Data Type: Datetime
[!INCLUDE operator-last-week-description]
Data Type: Datetime
[!INCLUDE operator-last-x-days-description]
Data Type: Datetime
[!INCLUDE operator-last-x-fiscal-periods-description]
Learn more about fiscal year settings
Data Type: Datetime
[!INCLUDE operator-last-x-fiscal-years-description]
Learn more about fiscal year settings
Data Type: Datetime
[!INCLUDE operator-last-x-hours-description]
[!INCLUDE operator-invalid-dateonly]
Data Type: Datetime
[!INCLUDE operator-last-x-months-description]
Data Type: Datetime
[!INCLUDE operator-last-x-weeks-description]
Data Type: Datetime
[!INCLUDE operator-last-x-years-description]
Data Type: Datetime
[!INCLUDE operator-last-year-description]
Data Type: Datetime
[!INCLUDE operator-le-description]
Data Types:
[!INCLUDE operator-like-description]
[!INCLUDE wildcard-string-operator]
Data Type: String
[!INCLUDE operator-lt-description]
Data Types:
[!INCLUDE operator-ne-description]
Data Types:
[!INCLUDE operator-ne-businessid-description]
Data Type: Unique Identifier
[!INCLUDE operator-ne-userid-description]
Data Type: Unique Identifier
[!INCLUDE operator-neq-description]
[!INCLUDE operator-next-fiscal-period-description]
Learn more about fiscal year settings
Data Type: Datetime
[!INCLUDE operator-next-fiscal-year-description]
Learn more about fiscal year settings
Data Type: Datetime
[!INCLUDE operator-next-month-description]
Data Type: Datetime
[!INCLUDE operator-next-seven-days-description]
Data Type: Datetime
[!INCLUDE operator-next-week-description]
Data Type: Datetime
[!INCLUDE operator-next-x-days-description]
Data Type: Datetime
[!INCLUDE operator-next-x-fiscal-periods-description]
Learn more about fiscal year settings
Data Type: Datetime
[!INCLUDE operator-next-x-fiscal-years-description]
Learn more about fiscal year settings
The following example shows a FetchXML expression that finds all opportunities with an estimated close date in the next three fiscal years, based on the organization's fiscal year settings. The value for x
is specified in the value column of the condition element.
<fetch>
<entity name="opportunity">
<attribute name="name" />
<filter type="and">
<condition attribute="estimatedclosedate"
operator="next-x-fiscal-years"
value="3" />
</filter>
</entity>
</fetch>
Data Type: Datetime
[!INCLUDE operator-next-x-hours-description]
[!INCLUDE operator-invalid-dateonly]
Data Type: Datetime
[!INCLUDE operator-next-x-months-description]
Data Type: Datetime
[!INCLUDE operator-next-x-weeks-description]
Data Type: Datetime
[!INCLUDE operator-next-x-years-description]
Data Type: Datetime
[!INCLUDE operator-next-year-description]
Data Type: Datetime
[!INCLUDE operator-not-begin-with-description]
[!INCLUDE wildcard-string-operator]
Data Type: String
[!INCLUDE operator-not-between-description]
Data Types:
[!INCLUDE operator-not-contain-values-description]
Data Type: Choice
[!INCLUDE operator-not-end-with-description]
[!INCLUDE wildcard-string-operator]
Data Type: String
[!INCLUDE operator-not-in-description]
Data Type: Number
[!INCLUDE operator-not-like-description]
[!INCLUDE wildcard-string-operator]
Data Type: String
[!INCLUDE operator-not-null-description]
Data Types:
[!INCLUDE operator-not-under-description]
Learn more about querying hierarchical data
Data Type: Hierarchical
[!INCLUDE operator-null-description]
Data Types:
[!INCLUDE operator-olderthan-x-days-description]
Data Type: Datetime
[!INCLUDE operator-olderthan-x-hours-description]
[!INCLUDE operator-invalid-dateonly]
Data Type: Datetime
[!INCLUDE operator-olderthan-x-minutes-description]
[!INCLUDE operator-invalid-dateonly]
The following example shows a FetchXML query that returns incidents that are older than 30 minutes.
<fetch>
<entity name="incident">
<attribute name="title" />
<attribute name="ticketnumber" />
<attribute name="createdon" />
<attribute name="incidentid" />
<filter type="and">
<condition attribute="createdon"
operator="olderthan-x-minutes"
value="30" />
</filter>
</entity>
</fetch>
Data Type: Datetime
[!INCLUDE operator-olderthan-x-months-description]
Data Type: Datetime
[!INCLUDE operator-olderthan-x-weeks-description]
Data Type: Datetime
[!INCLUDE operator-olderthan-x-years-description]
Data Type: Datetime
[!INCLUDE operator-on-description]
Data Type: Datetime
[!INCLUDE operator-on-or-after-description]
Data Type: Datetime
[!INCLUDE operator-on-or-before-description]
Data Type: Datetime
[!INCLUDE operator-this-fiscal-period-description]
Learn more about fiscal year settings
Data Type: Datetime
[!INCLUDE operator-this-fiscal-year-description]
Learn more about fiscal year settings
Data Type: Datetime
[!INCLUDE operator-this-month-description]
Data Type: Datetime
[!INCLUDE operator-this-week-description]
Data Type: Datetime
[!INCLUDE operator-this-year-description]
Data Type: Datetime
[!INCLUDE operator-today-description]
Data Type: Datetime
[!INCLUDE operator-tomorrow-description]
Data Type: Datetime
[!INCLUDE operator-under-description]
Learn more about querying hierarchical data
Data Type: Hierarchical
[!INCLUDE operator-yesterday-description]
Data Type: Datetime
[!INCLUDE footer-banner]