Auto-create SharePoint Folder (SharePoint Document Location) on record create using Power Automate Flow (Dataverse)


We recently had a requirement to create the SharePoint folder automatically on the Account records creation, instead of having the users click on the Documents tab to create it.

We could write a Power Automate flow to achieve this.

Here we have enabled the Share Point server-based integration. Also, the SharePoint Site and the main or parent folder for the Account are already created/configured.

Below is the corresponding Document location record for the parent Account folder.

  • So basically, we will create a new folder inside the Account folder in the SharePoint site configured in CRM.
  • Then create a new SharePoint Document Location record specifying the Account document location as a parent.
  • And then Associate / Relate the new account record created with this new document location record.

Below is how our Flow will look like –

  1. Triggers on Account record creation.

2. Create a new folder inside Account Folder, here for the name of the folder we are using the format “AccountName_AccountNumber

3. Create a new Document Location record, associating the Account document location with the parent location record. Here we are specifying the same folder name in the relative URL.

We can also fetch the GUID of the Account document location and/or use a variable to store the GUID.

4. Lastly, we are associating these 2 new records.

Below is our newly created account record.

Below we can see our flow ran successfully.

We can see the new folder created and associated.

Here if we click the Documents tab immediately after creating the account record, before our flow runs, we might have the OOB folder also getting created along with our custom folder (flow being asynchronous). If our custom folder is already created and associated before the user clicks on the documents tab, then CRM will not be creating a new folder.

Hope it helps..

Advertisements

How to – Upload a file by URL to SharePoint (Power Automate / Dataverse)


Recently we had a requirement to upload a document (pdf) to a SharePoint folder.

We had the URL of the field saved in one of the fields of the Contact table in Dynamics 365 / Dataverse.

Below is our field and the URL in it. (the URL points to the Manual of Fulla 2, one among many awesome products by Schiit)

Below is how our flow looks like

Here we already have Server-Based SharePoint integration enabled. https://nishantrana.me/2023/07/28/based-on-entity-behavior-for-sharepoint-folder-dynamics-365-dataverse/

The flow triggers when there is an update in the File URL field of the contact record.

Next, we are using HTTP action to use the GET method to get the content of the file. As it is a public URL we haven’t specified any Authentication.

Next, we are using Create File action of SharePoint, we have specified the Site Address, Folder Path, File Name, and most importantly the Body of the HTTP action to the File Content property.

On the successful run of the flow,

we can see the document (pdf) uploaded in the SharePoint folder.

Hope it helps..

Advertisements

Based on entity behavior for SharePoint Folder – Dynamics 365 / Dataverse


After enabling Server-Based SharePoint Integration,

inside Document Management Settings, we can specify folder structure to be based on the entity either Account or Contact.

Here we have opted for Account-based first.

We can see the following folders created on the SharePoint site, that take the table or entity name.

And the records folder for Accounts created with AccountName_GUID format.

And if we open any Contact record >> Files / Documents tab, that will create the account parent folder (if not already created) and the contact folders inside it as shown below.

And if we create the contact record without having an account associated

That will create the folder for the record inside Contact Folder without the Parent Account folder created. (as there was no account associated)

For Case Records, we have the case folders created inside Account folders.

Now let us select the Contact based structure

The contact records are created inside the Contact folder, the account associated is not considered.

For Case also it is same.

For Building, a custom table, which is a child of Contact, we have the Building folder created inside the Contact folder.

Now let us keep Based on entity option unchecked

This creates the corresponding record’s folder inside the table parent folder.

Account –

Contact –

Check some of the interesting articles on SharePoint and Dynamics 365 Integration.

Hope it helps..

Advertisements

Approval / When a file is created (properties only) – when a file is added to the folder in the SharePoint library


Recently we had a requirement to implement an approval workflow when a document is added to a SharePoint library.

Below is how we can implement it.

Details –

Trigger – When a file is created (properties only)

Specify the Site Address, Library Name, and the Folder on which the flow should run.

Initialize Variable

Initialize a variable VarComments to save all the responses.

Start and wait for an approval

Here we have used the Approval type as Custom Response – Wait for one response, we could also Approve / Reject – First to respond or any approval type based on the requirements.

The Assigned to field contains the name of the user who needs to review it.

The item link contains the link to the item.

Enable reassignment as Yes will allow the approver to reassign the approval to another user from the Approval Center.

Apply to each

Append the approval response to the variable VarComments.

Condition

If Outcome is Approved

If Yes – Update File Properties

Update the properties of the file using the ID.

Update the Approval Comments property with the variable.

Update the status value as Approved.

Repeat the same step for any other Outcome.

Check other blog posts on Approvals – https://nishantrana.me/2020/08/31/approvals-power-automate-dynamics-365/

Also check –https://manueltgomes.com/reference/power-automate-trigger-reference/when-a-file-is-created-properties-only-trigger/

Hope it helps..

Advertisements

Solved – You do not have permission to open this Web site in SharePoint Designer 2013


Recently we had installed SharePoint designer 2013, and while trying to open a SharePoint online web site.

However we were getting the below error.

“403 FORBIDDEN403 FORBIDDEN403 FORBIDDEN403 FORBIDDEN403 FORBIDDEN”

Installing the SharePoint designer SP 1 (64 bit in our case) https://www.microsoft.com/en-in/download/details.aspx?id=42009 fixed the issue.

Hope it helps..

Fixed – Exception calling “CreateSPNavigationNode” with “4” argument(s): Access is denied. (Exception from HRESULT: 0x80070005 (E_ACCESSDENIED)) in SharePoint 2013


Got this error while running a PowerShell script that creates Navigation in the portal.

Adding the logged in user as to Site Collection Administrator group fixed the issue.

http://alstechtips.blogspot.in/2014/07/sharepoint-2013-access-is-denied.html

Hope it helps..