Search code examples
c#sharepointdynamics-crmmetadata

Automate Sharepoint Metdata Fields values


One of my requirement for Microsoft dynamic CRM is to create an automatic folder structure in Sharepoint.

I have been able to create the folder structure from CRM using rest API services provided by SharePoint.

Now the next task is For every created folder I must have its names in the metadata field values.

For examples :

Folder A -- metaData FolderName - "Folder A" / subFolder --- metaData SubFolderName - "subFolder" -FileA --- metaData No - "subFolder"

If the user uploads anything in subfolder than its field value should be also a name of sub folder.

I have even managed to create metadata field values from SharePoint Rest API triggered in CRM. however, the solution is not 100% since when the user uploads a file in SharePoint I don't have any way to know if the file is uploaded.

So I need something in SharePoint Workflow, when folders are created and if the user uploads a file in some folder its field value is automatically added by the current folder name or from its parent folder.

Is this possible from within CRM since I have its rest Calls working whenever I create the folder I am adding the metadata. But when the user uploads a file it may have a default value?

Thank-you any solution would work from SharePoint or CRM.


Solution

  • Use Document Sets instead of folders for this. A Document Set is basically a super folder that has shared metadata. The shared metadata is then pushed automatically to any files or folders that are stored within the document set.

    You can see the differences for creating a Document Set via rest here

    On top of shared metadata Document Sets also have a pseudo-landing page with key metadata highlighted. And you can add templated documents to the document set as well. More info here