Blogs

Setting up the Custom Columns of SharePoint with Power Automate Flow and displaying them in Documents Grid in Dynamics 365 for Sales

, June 2, 20216677 Views

Many times while uploading the documents of Dynamics CRM to the SharePoint we require that the fields of Dynamics CRM be reflected in the SharePoint column and we could also see the value populated in SharePoint Column in CRM. If you have any such requirements, stay tuned, as this blog is going to cover all aspects of requirement. The only prerequisite to the blog, is that SharePoint and Dynamics 365 are integrated.

Here, let us take the scenario of an Account Wide World Importers, there is a tab named ‘Files’. Moving to that tab would automatically create a folder in SharePoint with format ‘Account Name_GUID’. There is a default Document Grid which gives the provision to upload the document directly to the SharePoint folder.

Suppose we have a custom column in SharePoint, in this case ‘Relationship Type’ and we want to populate the value of ‘Relationship Type’ column of SharePoint from the value of ‘Relationship Type’ field of Account while uploading Document from Document Grid.

We would need Power Automate Flow which would be Triggered on upload of a document in Account Document Library.

The folder name would be then extracted of the Uploaded Document and it will be compared with Document Location Entity’s relative URL to get the Document Location record associated with the folder, then regarding of that record would be Account in this case.

Fetching the required Accounts ‘Relationship Type’ Field’s Option Set text and populate it as Uploaded File’s properties column ‘Relationship Type’.

Do note, the ‘customertypecode’ is schema name of field ‘Relationship Type’ of Account.

Now whenever, the value of ‘Relationship Type’ is set in Account record, then uploading file from the Document will have the property(column) value of ‘Relationship Type’ in SharePoint set same as that of Account record.

Here, there are two documents uploaded, while uploading first document the Field ‘Relationship Type’ had value ‘Customer’, while uploading second it was ‘Reseller’, so similar values are reflected with the help of flow.

Now, when these values are updated, sometimes we just want to see the values of these columns of SharePoint in our Document Grid, the solution is simple, we just need to know that the Documents Grid is actually sub-grid of CRM Entity ‘SharePoint Document’, hence we just need to create the fields with the same name as the column in SharePoint and put them in the view, the Field should be of ‘Single Line Of Text’ Type irrespective of the Type of SharePoint Column we are trying to refer, except for the Date and Time column of SharePoint where we need to create Date and Time Field in order to refer to the SharePoint column.

In above picture, it is shown that Relationship Type field is created in SharePoint Document Entity, and this field is added as column in “All SharePoint Document” view, hence, when the Files tab is opened and the SharePoint custom column value is reflected in this field, though the SharePoint Column “Relationship Type” is of Choice type, we need to create the field with same display name in CRM SharePoint Document Entity with ‘Single Line of Text’ type.

Hope this helps

 


ATM Inspection PowerApp to ease ATM inspection and report generation process.
https://www.inkeysolutions.com/microsoft-power-platform/power-app/atm-inspection

Insert data into Many-to-Many relationship in Dynamics CRM very easily & quickly, using the Drag and drop listbox.
http://www.inkeysolutions.com/what-we-do/dynamicscrmaddons/drag-and-drop-listbox

Comply your Lead, Contact, and User entities of D365 CRM with GDPR compliance using the GDPR add-on.
https://www.inkeysolutions.com/microsoft-dynamics-365/dynamicscrmaddons/gdpr

Create a personal / system view in Dynamics CRM with all the fields on the form/s which you select for a particular entity using the View Creator.
http://www.inkeysolutions.com/what-we-do/dynamicscrmaddons/view-creator