Around middle of last week, I published v1.0 of a new XrmToolBox tool called Entity Image updater. I created this tool so that it is easier to update the images on the crm record, if that entity has an image field.
When an entity has an image field and no image has been uploaded, it displays the default person image next to the primary name label.
You can upload an image, by clicking the person image and choosing a local file.
- You need source the images
- Manually upload them one by one OR write code to upload them based on some conditions
There are so many APIs available to retrieve this data. The most useful of these APIs for this task are
- Clearbit – Retrieve logo based on an organisation URL
- Twitter – Retrieve logo based on a Twitter handle
- Gravatar – Retrieve logo based on a person’s email. This works only if this person has a Gravatar profile
We can try to first source the logo/avatar from these APIs, and we fail to retrieve we can still fallback to uploading an image that is relevant. This is where I believe this tool will be useful. Here is how it looks after the tool has updated the entity images.
- Download the latest version of XrmToolBox.
- Install the tool from the XrmToolBox store. Refer http://mscrmtools.blogspot.com.au/2016/04/welcome-to-xrmtoolbox-plugins-store.html for additional details.
Using the Tool
- After opening the tool, click “Load Entities” to display all entities
- Choose an entity that has an entity image field. You’ll know that an entity has this field, if it has the person default image on the form. This is important, as I currently don’t check if the entity has this field or not. I plan to do this in the next version.
- Choose a source for the images. If you chose “Local Folder” you will be asked to select the folder that has the images. Please ensure that the folder has the right sized images. I plan to add resize, upload capability in the future version for “Local Folder” option
- Choose an attribute whose value you would use to search. For eg. if you choose “Clearbit”, select a field that has the company’s Url. This could be the file name, if you chose “Local Folder” (only png, jpg and jpeg images can be used, if you chose this option)
- Click on “Update All“, if you would like to lookup and update all the records for this entity
- If you would like to specify a criteria for update, then click the “Selective Update” field. For eg. you might want to only update records that were created by you. This will open FetchXML Builder that will help you build the conditions. Currently there is a 5-10 second delay in opening the FXB tab. I am still investigating the reason for this delay and will update the tool, once I figure out the fix. The tool will start the update process, straight after you click “Return FetchXML” in the FetchXML Builder tool
The tool will display all the images that were updated in the results window. I haven’t added the capability to save these images to disk, but I will add it in the future if that is a useful feature. I hope this tool will help all CRM folks to fully utilise the entity image field. Please feel free to use the Entity Image Uploader Issues area to log any issues that you encounter.
Thank you to
- Guido and Adam for their feedback and suggestions
- Tanguy for XrmToolBox
- Daryl aka DLaB for the XrmToolBox improvements
- Jonas for FetchXml Builder
Source code for this tool can be found at https://github.com/rajyraman/Ryr.XrmToolBox.EntityImageUpdater