Thursday, 16 July 2020

Finally we have Column Comparison in FetchXml, SDK and OData!

Microsoft has made an announcement and finally we have Column Comparison available using FetchXml, SDK and OData.

Now we will be able to perform column comparisons for the Common Data Service. Column comparisons will also work in the Power Apps expression language with CDS version 9.1.0000.19562 or later.

We can perform a column comparison for the following condition operators using FetchXML, Web API, or the SDK API:

  • Equal
  • NotEqual
  • GreaterThan
  • GreaterEqual
  • LessThan
  • LessEqual

Columns comparison using FetchXML:

  <entity name='contact' >
    <attribute name='firstname' />
      <condition attribute='firstname' operator='eq' valueof='lastname'/>

Columns comparison using Web Api:

https://<environment-root>/contacts?$select=firstname&$filter=firstname eq lastname

Columns comparison using SDK Api & Organization Service:

public ConditionExpression
  string attributeName,
  ConditionOperator conditionOperator,
  bool compareColumns,
  object value

public ConditionExpression
  string attributeName,
  ConditionOperator conditionOperator,
  bool compareColumns,
  object[] values

Premjit Singh
Attendite Ltd.