Thursday, June 26, 2014

Power Query Fetching Specific Entity and Columns From Dynamic CRM

We can use Odata query as source in Power Query to fetch data from Dyanamic CRM.

But while fetching data from CRM we face below issues:

  1. All Entities present in that instance of CRM are loaded and then we need to select particular entity to load its data
  2. When we select particular entity all its columns are returned and we need to clean up i.e delete columns not required.  
To overcome first issue we can specify entity name in OData query: 

https://abcd.crm5.dynamics.com/xrmservices/2011/OrganizationData.svc/ContactSet

Above query loads data only from Contacts entity


To overcome 2nd column we can also specify required columns in OData query as below:

https://abcd.crm5.dynamics.com/xrmservices/2011/OrganizationData.svc/ContactSet?$select=FullName,Address1_City

Above query only loads name and city columns from contacts entity


Now sometimes even creating OData with specific Entity and columns name can become a tedious task as names are case sensitive.

To solve this problem we can use below tool which helps to design OData Queries for CRM

CRM 2011 OData Query Designer

Tool can be downloaded from here: http://crm2011odatatool.codeplex.com/

No comments:

Post a Comment