Retrieve Records by comparing two Columns in Web API Query

Hi learners,

Till now, $filter can be applied for a field against a constant value. With this new feature $filter can be applied for a field against another field in scenarios like below

  • Get all contacts where First Name = Last Name
  • Get all Opportunities where Estimated Revenue >= Actual Revenue
  • Get all Cases Resolved post due date.

Supported Filters:

  1. Equal
  2. NotEqual
  3. GreaterThan
  4. GreaterEqual
  5. LessThan
  6. LessEqual

Example: To retrieve all contacts whose First Name = Last Name

Web API Query:

<Instance Web API>/contacts?$filter=firstname eq lastname
[ Note: This Web API expression works only for version 9.1.0000.19562 or later ]

fetch XML Query:



Use SQL Connection to Query CDS / Dynamics 365 Data (Works with SSMS and Power BI)

Hello Learners, here is the key take-away from Microsoft Business Applications Summit (MBAS)-2020.

Power Platform provides Tabular Data Stream (TDS) endpoint for CDS, using which we can access environment’s data using SSMS just like how we access the data in on-premise environment (*Only Read is permitted, cannot perform Updates)

**Image Source – Microsoft Docs

Below are the key points to remember.

  1. Its in Preview and not available for all regions. It works only with version and above. Check if the latest version is available for your region here. Alternatively you can check the version of your Environment from Settings –>About.

2. To use the SQL connection, you need to enable the Tabular Data Stream (TDS) endpoint using below options

a) Using OrgDBOrgSettingsToolStep-By-Step guidance for the same is available here.
b) Go to -> Environments ->(select environment)-> Settings -> Features , and turn Enable TDS EndPoint on.

3. SQL Connection’s Server Name would be <organization url>,5558 (5558 is the port used for TDS endpoint. it is same for all organizations). For authentication, we can use the same Active Directory Credentials that we use to access the Organization. Application Users with Azure Client ID are not supported for now. Step-By-Step guidance is available here

4. The same SQL Connection Can be used in Power BI to analyse data. Step-By-Step guidance HERE

References for more details: