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:
<fetch>
<entity name='contact' >
<attribute name='firstname' />
<filter>
<condition attribute='firstname' operator='eq' valueof='lastname'/>
</filter>
</entity>
</fetch>
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 )
Following link provide more details: https://docs.microsoft.com/en-us/powerapps/developer/common-data-service/column-comparison