web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / CDS-SharePoint Documen...
Power Apps
Answered

CDS-SharePoint Document Management How To

(0) ShareShare
ReportReport
Posted on by

Hi all!

I'm making this post because I really just need help understanding how I can upload my files in SharePoint and then have those files linked to records in a custom entity in CDS. I’ll outline how ideally I would want this to work, and the steps I’ve taken so far. Finally, I’ll ask my general questions just about SharePoint’s document storage for CDS.

 

My Ideal Goals:


I’m working only with canvas PowerApps and CDS. Not Dynamic365 or model driven apps.
My goal is to have a folder full of documents/images for a new project at work stored locally on my computer. I then go into SharePoint, create a new folder in SharePoint that is the name of the project, then I upload my locally stored folder full of files to this folder in SharePoint. Once I upload those project files into SharePoint, I would then like to create a new record for each of those files in my custom entity. So, after uploading Doc1 in SharePoint I could create a new record in CustomEntity that is tied to the document in SharePoint. Ideally, I would also like to change certain field values in CDS when I connect them to the SharePoint document. Once all that is said and done, I’d have a PowerApp where I can view my files stored in SharePoint.


Eg: let’s say I own a construction company, and my current job is to build the Empire State Building. One of my projects in that job is to finalize all blueprints. I create a “Empire State Building Blueprints” folder in SharePoint and upload all my blueprints. I also have a “Blueprints” custom entity in CDS, where I have different metadata information about the blueprints, such as the Contacts associated with my blueprints, the floor a blueprint is on, the construction workers in charge of the blueprints, the square-footage on the blueprint, etc. This “Blueprints” entity is where I keep metadata on my blueprints for all my jobs, not just the Empire State Building one. But let’s say I already have my blueprints folders locally separated by floor. I also have a “Floor” field in my “Blueprints” custom entity. If I were to upload all of my blueprints for the Empire State Building int “Empire State Building Blueprints” folder in SharePoint, could I also pass a comment about the floor number that each blueprint is on, and could I then pass that information into the “Floor” field in my custom entity “Blueprints?” If I want to view my blueprints in a canvas app, would I be connecting to my SharePoint folder “Empire State Building Blueprints” directly or to my “Blueprints” custom entity?

 

What I’ve Done Already:


So far I have enabled SharePoint Document Management in my custom entity settings. After doing that, I uploaded some test documents to a new folder in SharePoint. I then went back into CDS, went into my custom entity, and clicked “Get Data” and tried to get data from this new folder I created in SharePoint. After clicking “Get Data,” then “SharePoint folder,” I put in the site URL and my connection credentials. I keep getting the error “Invalid Credentials,” even though I have access to SharePoint and am an admin in PowerApps and CDS. After running into this error, I’m not sure how to use these SharePoint files to create new records in my CDS custom entity.

 

General Questions:


How are SharePoint documents and CDS records linked together? How will I see that link to SharePoint in individual records in CDS? Do I ever have to store files in CDS directly in order to then store them in SharePoint? Can I update fields in my records in CDS when I connect them to a SharePoint document? Can I see in my CDS custom entity record the hyperlink to the SharePoint URL where the document pertaining to that record is stored?

 

I know this is a lot, and any help I could get in pointing me in the right direction in order to achieve my ideal goals would be great. Even if it’s just links to information. I can’t seem to find a lot detailing exactly how to complete the SharePoint document management that isn’t centered around how to do it with Dynamics365 and model driven apps, neither of which I’m working with.

 

Thank you!!

I have the same question (0)
  • Verified answer
    ChrisPiasecki Profile Picture
    6,422 Most Valuable Professional on at

    Hi Jacktransform, 

     

    Edit: before getting into the SharePoint doc mgmt details, I thought I'd mention that there is the File field type for CDS entities that you may want to consider for your Blueprint entity for example, it will be easier to work with out of the box and inside your canvas app and less maintenance effort overall. 

     

    Now, with regards to SharePoint integration.. When you setup document management settings and select entities, it will create a "Document Location" entity record for each of the document libraries it setup. When you are browsing an entity record in CDS there is a Documents related tab, when you browse this the first time for a particular record, it will ask you if you want to create a folder for it. If you do, it creates the folder in SharePoint and then a Document Location entity record with the path to the folder. It will have a parent Document Location which is the document library created for the entity configured in the Document Settings wizard. 

     

    CDS will only track libraries and folders, not individual files added within the library or folders. You would need to track these through a custom entity like the one you created. You can use Power Automate and the SharePoint connector "when a file is created or modified" trigger and create/update the CDS record to store your file metadata. 

     

    Im not sure what you need your Power App to do beyond listing the files, but you can just use your CDS entity as data source to list your files. 

     

    Hope this helps. 

     

     

    - Chris

     

     

  • Community Power Platform Member Profile Picture
    on at

    @ChrisPiasecki 

    Thanks, Chris!

     

    Just for clarification; when you say "it will create a 'Document Location' entity record for each of the document libraries it setup," you mean that it will create a field in your entity named "Document Location," correct?

     

    I also wanted to ask if I can link multiple libraries, even ones from different SharePoint sites, to one entity in CDS by using the SharePoint document management tools CDS has?

     

    Finally, I wanted your opinion on this work around and if it would work. (This work around assumes that when I enable SharePoint document management, CDS creates a document library for me that must be a parent to all the files stored in my CDS entity. Correct me if this assumption is wrong.) Say I didn't want to store my files in the document library that is created for me. In order to track my files in SharePoint, couldn't I do a Power query and have a field in CDS that specifies the file's GUID and path? Do I have to store all my files in the document library that the entity created for me? Is there a benefit to using the document library that CDS creates for me? Like I said earlier, I want to link multiple libraries, even ones from different SharePoint sites, to one entity in CDS, and figure that this work around might be better than using the SharePoint document library that CDS creates for me. Please let me know if I'm not understanding how CDS and SharePoint integration actually works.

     

    Thanks!

  • ChrisPiasecki Profile Picture
    6,422 Most Valuable Professional on at

    Hi Jacktransform, 

     

    Not a field, but a Document location record, which will contain the relative or absolute path to the document library.

     

    You could have multiple locations associated on any particular record. When you navigate to the associated document tab for your entity record, you can create a new document location in the default SharePoint site that you set up during document mgmt configuration. Yes you can have multiple sites, but only one site can be set as a default at a time.

     

    You don't have to use the document management integration, you could as you say just store a reference to the guid or url in a cds entity field. It might be the simplest option for your needs and probably makes more sense as you are interested in tracking the specific document and metadata in cds, which is not what the default integration does. 

     

    Hope this helps. If I answered your questions, feel free to mark my response as an accepted answer. 

     

    Thanks, 

    - Chris

     

     

  • Verified answer
    Community Power Platform Member Profile Picture
    on at

    @ChrisPiasecki 

    Thanks Chris, 

     

    I think what I'm going to do is store my documents in Azure Blob storage instead. It's quicker and easier retrieval in PowerApps, plus not as costly to store a bunch of files. For more information on Azure blob storage and CDS:

     

    https://powerapps.microsoft.com/en-us/blog/upload-files-from-powerapps-using-the-azure-blob-storage-connector/

     

    For anyone curiously reading this later on; I think I'm going to create a document library in SharePoint with certain columns that I can fill out easily in "quick edit" while I am completing a data upload to the library. I'm then going to set up a flow that will take the column information in a SharePoint document library and map that data into fields in my custom entity, copy the file into Azure blob storage, map the Azure blob storage path/name/GUID into my custom entity, and then delete the document from the SharePoint document library.

     

    If using a Power Automate flow doesn't work, I'll have to try using Azure's Data Factory as my dataflow. I'll probably hold off on deleting the documents in SharePoint until I know the flow is working 100%, or depending on the storage costs just keep the documents in SharePoint as backups.

     

    Azure Data Factory info:

    https://docs.microsoft.com/en-us/azure/data-factory/connector-azure-blob-storage

    https://docs.microsoft.com/en-us/azure/data-factory/introduction

    https://docs.microsoft.com/en-us/azure/data-factory/connector-dynamics-crm-office-365

     

    Thanks for all your help!

  • jaredbidlow Profile Picture
    256 on at

    Hello. I'm interested to hear about your solutions, and governance of them. This stage of the records management cycle is woefully underlooked-in-to. 

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 711 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 319 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard