Dynamics attributes utilisation by FetchXML

XrmToolbox is an amazing free utility formed by many tools that have been developed by the community. During the last weeks, I have been particularly using and enhancing the Attribute Usage Inspector. This tool tells you the fields utilisation in your Dynamics 365 Customer Engagement (CRM) environment.

Figure 1 – Opportunity attributes utilisation for all records

In this article, I’ll show how I have extended this utility to allow FetchXML queries which defines the scope of the attributes to be analysed.

Visualising what attributes are used and what aren’t can be extremely helpful in your project analysis to understand adoption and drive new features.

In the above Figure – 1, you can see the attributes utilisation for the opportunity entity. In this case, the tool is using all the records and attributes in the system. You could also filter these attributes or even use a SQL query:

Figure 2 – Attribute Usage Inspector Settings. New FetchXML query option.

Additionally, I have recently added a new option to allow a FetchXML query (see “Use FetchXML query” in above Figure 2), which will define what attributes and records will be analysed  based on the results of the same query. 

Once you have selected the new setting “Use FetchXML query“, you will find a new dialog after you click on an entity:

Figure 3 – FetchXML Query dialog

The new FetchXML Query dialog allows basically 3 things:

  1. Generate the FetchXML query using a System View.
  2. Generate the FetchXML query using a User View.
  3. Use your own FetXML query just editing or pasting the text in the editor.

The FetchXML Query dialog also validates the query in run time to avoid potential mistakes. 

For instance, let’s say we want to understand certain opportunity attributes utilisation for those records created in the last months. Using the XrmToolbox FetchXmlBuilder, I have generated my own FetchXML:


Figure 4 – FetchXML Builder tool to generate custom FetchXML

I will then paste the same query in the FetchXML Query dialog shown in Figure 3:

Figure 5 – Attribute Usage Inspector using a custom FetchXML query

After clicking OK, the tool will use the same custom query to provide the corresponding results:


Figure 6 – Attribute Usage Inspector results with a custom FetchXML query

Notice how only a subset of the attributes are presented in the results and the number of records and % utilisation are determined by the FetchXML query.

How do I get this tool?

After you have downloaded the main XrmToolbox utility from https://www.xrmtoolbox.com, go to its Plugins Store and search for “Attribute Usage”, then install the Attribute Usage Inspector plugin:


Figure 7 – Install Attribute Usage Inspector from XrmToolBox Plugins Store

In case you were already using it, notice there is a new version 1.2018.9.11, which contains the new FetchXML query feature.

Where is the code?

The whole tool is open source and you can find the code here:

https://github.com/MscrmTools/MscrmTools.AttributeUsageInspector

https://github.com/rtebar/MscrmTools.AttributeUsageInspector

About Ramon Tebar

Software Engineer specialised on Microsoft Technologies with experience in large projects for different industrial sectors as developer, consultant and architect. I enjoy designing and developing software applications, it is my job and one of my hobbies. I’m interested in design patterns, new technologies and best practices. Making those part of the ALM process is a great challenge. During the last years, I have specialised in Microsoft Dynamics CRM (now Dynamics 365). I customise and extend the platform to provide tailored solutions and integrations based on service-oriented architectures and messages queuing. Motivated by community events and contributor in blogs, technical books, open source projects and forums, I have been awarded Microsoft Most Valuable Professional (MVP) on Dynamics 365 (CRM) since 2012.

Posted on September 19, 2018, in Dynamics 365, XrmToolBox and tagged , , , . Bookmark the permalink. Leave a comment.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: