Copy Share Point Document From One Entity to Another

Introduction


In an earlier article we discussed how we can create Document Location Record using Flow. Now let’s say if after creating a document location record we also want to copy a document from one entity to another. In our case we are creating a contact from account and let’s say we want to copy a Share Point document from accounts to contact. In this article we are going to discuss how we can do this using Flow.
 

Details


Before going to details make sure you have gone through our earlier blog first.
After following the  first blog, you can create contact entity and document location folder for contact entity. Now to copy files from account entity to contact we can use the following steps.
 
Make sure you have completed the flow up to the following steps:
 
 
> Next Click on + New Step to add new step

> Search Share Point and select Get Files (property only) action
 
 
We will use this steps to get properties details of the files.

> We need to configure it like the following.
 
 
As in the above steps we want to retrieve all the files from account folder so we have used the following query under Limit Entries to Folder:
/account/Account Naame_toUpper(replace(triggerBody()?[‘entity’]?[‘accountid’],’-‘,”))
 
> Again click on + New Step and add Copy files action from Share Point. We need to configure the following properties of this action.
 
 
In the above steps we need to configure destination folder path like the following,
 
/contact/FullName_ContactId
 
We are using variable where we have already formatted contact id in the required format. We can use Dynamic Content to get FullName from Contact create action.
 

Summary


We can use the above actions to copy files from one entity folder to another entity if required using flow. While setting up path make sure to set it up like out of the box Share Point integration .
 
I hope this will help someone!

Keep learning, keep sharing!!