Skip to content

Commit 8f7ae6e

Browse files
authored
Merge pull request MicrosoftDocs#3199 from MicrosoftDocs/repo_sync_working_branch
Confirm merge from repo_sync_working_branch to master to sync with https://github.com/MicrosoftDocs/powerapps-docs (branch live)
2 parents 611ee58 + 4efb9cd commit 8f7ae6e

File tree

1 file changed

+17
-9
lines changed

1 file changed

+17
-9
lines changed

powerapps-docs/developer/common-data-service/org-service/use-conditionexpression-class.md

Lines changed: 17 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
title: "Use the ConditionExpression class (Common Data Service) | Microsoft Docs" # Intent and product brand in a unique string of 43-59 chars including spaces
33
description: "Read how you can use the ConditionExpression class to compare an attribute to a value or set of values by using an operator, such as "equal to" or "greater than"" # 115-145 characters including spaces. This abstract displays in the search result.
44
ms.custom: ""
5-
ms.date: 10/31/2018
5+
ms.date: 08/03/2020
66
ms.reviewer: "pehecke"
77
ms.service: powerapps
88
ms.topic: "article"
@@ -105,20 +105,28 @@ public ConditionExpression
105105
)
106106
```
107107

108-
In the SDK, two APIs are introduced to support column comparison. The
109-
first identifies the original attribute, the second allows
110-
for the inclusion of the attribute you want to compare it against.
108+
By passing in `true` as the value for the `compareColumns` parameter, the `value` is treated as the
109+
name of the second attribute to compare the values in `attributeName` to. Pass in `false` to treat it
110+
as a literal value instead.
111111

112-
If `compareColumns` is passed in as `true`, it will compare the two attributes
113-
and return all records that match.
112+
For example:
114113

115-
If a `false` value is passed, it will return all records for one attribute and
116-
return values that match the provided value.
114+
```csharp
115+
new ConditionExpression("firstname", ConditionOperator.Equal, true, "lastname");
116+
```
117+
118+
This code creates a condition to return only records where the first and last names are the same, while
119+
120+
```csharp
121+
new ConditionExpression("firstname", ConditionOperator.Equal, false, "John");
122+
```
123+
124+
creates a condition to return only records where the first name is John.
117125

118126
More information: [Use column comparison in queries](../column-comparison.md)
119127

120128
### See also
121129
[Building Queries](build-queries-with-queryexpression.md)
122130
[Build Queries with QueryExpression](build-queries-with-queryexpression.md)
123131
[Use the FilterExpression Class](use-filterexpression-class.md)
124-
<xref:Microsoft.Xrm.Sdk.Query.ConditionExpression>
132+
<xref:Microsoft.Xrm.Sdk.Query.ConditionExpression>

0 commit comments

Comments
 (0)