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!!