Sometime we required to get full path of the image which we have uploaded to Share Point document for specific entity. In this article I am going to demonstrate how Microsoft Flow can be used to implement this requirement. Feel free to comment if there is another easy of doing this.
This article is assuming you have basic understanding of Dynamics 365 CE Share Point integration and Flow as well as Share Point integration is already configured.Keep in mind this is for the demo purpose but you can change it accordingly to your requirement.
Now Navigate to Flow and using Following steps:
> Click on New and select automatic flow having following trigger
> Now let’s add some variable which we require for formatting URLs, Click on + New Step and search for variable and select Initialize Variable, In this variable we are going to set our Share Point Site URL.
In above express I am using following formula
We are using following formula in above variable
> Now under yes, blow first we are going to set folder path, this step may vary based on your entity name ,
I am using following formula to set variable
Above 8 is count of entity +1 so for example cotnact/ will be 8
> Next we need to query document location record based on the folder path, we can use Dataflex (Common Data Service current) connector. Select List records and set it’s property like following
In above we are going to query Document Locations record based on the Folder Path variable
> Finally add a Update action from Dataflex (Common Data Service current) connector and set it’s properties like following
Finally try to upload image to your entity you should see image URL populated after some time
So if you are need file name with extension or need path of the file you can use above Flow to store file name in CRM.
Hope it will help someone!
Keep learning, Keep sharing !!