cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Anonymous
Not applicable

CDS-SharePoint Document Management How To

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

2 ACCEPTED SOLUTIONS

Accepted Solutions
ChrisPiasecki
Most Valuable Professional
Most Valuable Professional

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

 

 

---
Please click Accept as Solution if my post answered your question. This will help others find solutions to similar questions. If you like my post and/or find it helpful, please consider giving it a Thumbs Up.
Chris

View solution in original post

Anonymous
Not applicable

@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-...

 

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!

View solution in original post

5 REPLIES 5
ChrisPiasecki
Most Valuable Professional
Most Valuable Professional

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

 

 

---
Please click Accept as Solution if my post answered your question. This will help others find solutions to similar questions. If you like my post and/or find it helpful, please consider giving it a Thumbs Up.
Chris
Anonymous
Not applicable

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

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

 

 

---
Please click Accept as Solution if my post answered your question. This will help others find solutions to similar questions. If you like my post and/or find it helpful, please consider giving it a Thumbs Up.
Chris
Anonymous
Not applicable

@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-...

 

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!

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. 

Helpful resources

Announcements

Community will be READ ONLY July 16th, 5p PDT -July 22nd

Dear Community Members,   We'd like to let you know of an upcoming change to the community platform: starting July 16th, the platform will transition to a READ ONLY mode until July 22nd.   During this period, members will not be able to Kudo, Comment, or Reply to any posts.   On July 22nd, please be on the lookout for a message sent to the email address registered on your community profile. This email is crucial as it will contain your unique code and link to register for the new platform encompassing all of the communities.   What to Expect in the New Community: A more unified experience where all products, including Power Apps, Power Automate, Copilot Studio, and Power Pages, will be accessible from one community.Community Blogs that you can syndicate and link to for automatic updates. We appreciate your understanding and cooperation during this transition. Stay tuned for the exciting new features and a seamless community experience ahead!

Summer of Solutions | Week 4 Results | Winners will be posted on July 24th

We are excited to announce the Summer of Solutions Challenge!   This challenge is kicking off on Monday, June 17th and will run for (4) weeks.  The challenge is open to all Power Platform (Power Apps, Power Automate, Copilot Studio & Power Pages) community members. We invite you to participate in a quest to provide solutions in the Forums to as many questions as you can. Answers can be provided in all the communities.    Entry Period: This Challenge will consist of four weekly Entry Periods as follows (each an “Entry Period”)   - 12:00 a.m. PT on June 17, 2024 – 11:59 p.m. PT on June 23, 2024 - 12:00 a.m. PT on June 24, 2024 – 11:59 p.m. PT on June 30, 2024 - 12:00 a.m. PT on July 1, 2024 – 11:59 p.m. PT on July 7, 2024 - 12:00 a.m. PT on July 8, 2024 – 11:59 p.m. PT on July 14, 2024   Entries will be eligible for the Entry Period in which they are received and will not carryover to subsequent weekly entry periods.  You must enter into each weekly Entry Period separately.   How to Enter: We invite you to participate in a quest to provide "Accepted Solutions" to as many questions as you can. Answers can be provided in all the communities. Users must provide a solution which can be an “Accepted Solution” in the Forums in all of the communities and there are no limits to the number of “Accepted Solutions” that a member can provide for entries in this challenge, but each entry must be substantially unique and different.    Winner Selection and Prizes: At the end of each week, we will list the top ten (10) Community users which will consist of: 5 Community Members & 5 Super Users and they will advance to the final drawing. We will post each week in the News & Announcements the top 10 Solution providers.  At the end of the challenge, we will add all of the top 10 weekly names and enter them into a random drawing.  Then we will randomly select ten (10) winners (5 Community Members & 5 Super Users) from among all eligible entrants received across all weekly Entry Periods to receive the prize listed below. If a winner declines, we will draw again at random for the next winner.  A user will only be able to win once overall. If they are drawn multiple times, another user will be drawn at random.  Individuals will be contacted before the announcement with the opportunity to claim or deny the prize.  Once all of the winners have been notified, we will post in the News & Announcements of each community with the list of winners.   Each winner will receive one (1) Pass to the Power Platform Conference in Las Vegas, Sep. 18-20, 2024 ($1800 value). NOTE: Prize is for conference attendance only and any other costs such as airfare, lodging, transportation, and food are the sole responsibility of the winner. Tickets are not transferable to any other party or to next year’s event.   ** PLEASE SEE THE ATTACHED RULES for this CHALLENGE**   Week 1 Results: Congratulations to the Week 1 qualifiers, you are being entered in the random drawing that will take place at the end of the challenge. Community MembersNumber of SolutionsSuper UsersNumber of Solutions @anandm08  23 @WarrenBelz  31 @DBO_DV  10 @Amik  19 AmínAA 6 @mmbr1606  12 @rzuber  4 @happyume  7 @Giraldoj  3@ANB 6 (tie)   @SpongYe  6 (tie)     Week 2 Results: Congratulations to the Week 2 qualifiers, you are being entered in the random drawing that will take place at the end of the challenge. Community MembersSolutionsSuper UsersSolutions @anandm08  10@WarrenBelz 25 @DBO_DV  6@mmbr1606 14 @AmínAA 4 @Amik  12 @royg  3 @ANB  10 @AllanDeCastro  2 @SunilPashikanti  5 @Michaelfp  2 @FLMike  5 @eduardo_izzo  2   Meekou 2   @rzuber  2   @Velegandla  2     @PowerPlatform-P  2   @Micaiah  2     Week 3 Results: Congratulations to the Week 3 qualifiers, you are being entered in the random drawing that will take place at the end of the challenge.   Week 3:Community MembersSolutionsSuper UsersSolutionsPower Apps anandm0861WarrenBelz86DBO_DV25Amik66Michaelfp13mmbr160647Giraldoj13FLMike31AmínAA13SpongYe27     Week 4 Results: Congratulations to the Week 4 qualifiers, you are being entered in the random drawing that will take place at the end of the challenge.   Week 4:Community MembersSolutionsSuper UsersSolutionsPower Apps DBO-DV21WarranBelz26Giraldoj7mmbr160618Muzammmil_0695067Amik14samfawzi_acml6FLMike12tzuber6ANB8   SunilPashikanti8

Check Out | 2024 Release Wave 2 Plans for Microsoft Dynamics 365 and Microsoft Power Platform

On July 16, 2024, we published the 2024 release wave 2 plans for Microsoft Dynamics 365 and Microsoft Power Platform. These plans are a compilation of the new capabilities planned to be released between October 2024 to March 2025. This release introduces a wealth of new features designed to enhance customer understanding and improve overall user experience, showcasing our dedication to driving digital transformation for our customers and partners.    The upcoming wave is centered around utilizing advanced AI and Microsoft Copilot technologies to enhance user productivity and streamline operations across diverse business applications. These enhancements include intelligent automation, AI-powered insights, and immersive user experiences that are designed to break down barriers between data, insights, and individuals. Watch a summary of the release highlights.    Discover the latest features that empower organizations to operate more efficiently and adaptively. From AI-driven sales insights and customer service enhancements to predictive analytics in supply chain management and autonomous financial processes, the new capabilities enable businesses to proactively address challenges and capitalize on opportunities.    

Updates to Transitions in the Power Platform Communities

We're embarking on a journey to enhance your experience by transitioning to a new community platform. Our team has been diligently working to create a fresh community site, leveraging the very Dynamics 365 and Power Platform tools our community advocates for.  We started this journey with transitioning Copilot Studio forums and blogs in June. The move marks the beginning of a new chapter, and we're eager for you to be a part of it. The rest of the Power Platform product sites will be moving over this summer.   Stay tuned for more updates as we get closer to the launch. We can't wait to welcome you to our new community space, designed with you in mind. Let's connect, learn, and grow together.   Here's to new beginnings and endless possibilities!   If you have any questions, observations or concerns throughout this process please go to https://aka.ms/PPCommSupport.   To stay up to date on the latest details of this migration and other important Community updates subscribe to our News and Announcements forums: Copilot Studio, Power Apps, Power Automate, Power Pages

Users online (621)