Store Files Cost-Effectively: Link SharePoint Libraries to Model-Driven Apps
Leverage SharePoint's low-cost storage, version history, and metadata to manage documents directly inside your model-driven app.
When you need to store documents – contracts, proposals, images – inside a model-driven app, Dataverse file storage is not always the most economical or feature-rich choice. SharePoint document libraries cost roughly $0.20/GB compared to $40/GB for Dataverse, and they include built-in versioning, co-authoring, and rich metadata. The good news: you can connect a SharePoint site to any table in a model-driven app and store files directly in that library. This article walks through the integration using a real‑world example.
Scenario: Engagement Management for a Consulting Firm
A consulting firm called Contoso Consulting wants its consultants to store engagement documents inside Power Apps without leaving the model-driven interface. They have a custom table named Engagement with the following columns:
- Engagement Name (Text)
- Client Company (Text)
- Service Line (Choice: Advisory, Audit, Tax, Tech)
- Budget (Currency)
- Status (Choice: Active, Pending, Closed)
Sample records look like this:
-
Engagement Name: 2026-001 – Cloud Readiness Assessment Client Company: Northwind Traders Service Line: Tech Budget: 45,000.00 Status: Active
-
Engagement Name: 2026-002 – SOX Compliance Review Client Company: Contoso Pharmaceuticals Service Line: Audit Budget: 120,000.00 Status: Pending
-
Engagement Name: 2026-003 – State Tax Filing Client Company: Alpine Ski House Service Line: Tax Budget: 8,500.00 Status: Closed
The app’s main form shows these fields, and the main view lists all engagements. All documents for an engagement (e.g., SOW, signed contracts, deliverables) should live in SharePoint.
Step 1: Create the Table and Model-Driven App
- Open the Power Apps maker portal and create a solution. Inside it, add a new table named Engagement with the columns listed above.
- Build a Main Form that includes the engagement fields. Build the Engagement Main View to show the fields you care about (e.g., Name, Client, Status).
- Create a model-driven app and add the Engagement table as a page. Publish the app and assign appropriate security roles.
No document library exists yet – that’s the next step.
Step 2: Provision a SharePoint Site
You need a SharePoint site that will host the document libraries. Create a new SharePoint Team site (communication sites work too, but team sites are simpler for this integration). Name it something like ContosoEngagementDocs. No additional configuration is required; the integration will handle the structure automatically.
Step 3: Enable Server-Based SharePoint Integration
Now connect Power Apps to SharePoint.
- In the model-driven app (or the maker portal), click the gear icon (Settings) in the top‑right corner and choose Advanced Settings.
- Under System, select Document Management.
- Click Enable Server-Based SharePoint Integration.
()PrerequisitesEnsure you have a valid SharePoint license and that the SharePoint site you intend to use is accessible to all users who will interact with documents. The integration uses the same site for all tables you connect.
- In the wizard, choose Online as the deployment type.
- Provide the full URL of the site you created (e.g.,
https://contoso.sharepoint.com/sites/ContosoEngagementDocs). Click Next. - Wait while the site is validated. Once successful, click Enable.
A confirmation message appears when the integration is active.
Step 4: Define Which Tables Use a Document Library
With the SharePoint integration enabled, you must tell Power Apps which tables should get their own document library.
- Return to Advanced Settings > Document Management.
- Click Document Management Settings.
- Select the Engagement table (you can choose multiple tables if needed).
- Do not check Based on Entity unless you are using the Account or Contact standard tables.
- Click Next. The wizard automatically creates a SharePoint document library named after the table (e.g., Engagement). Wait for the creation process to finish.
- On the final page you see the Document Library Creation Status. Verify it shows Succeeded and click Finish.
Behind the scenes, a SharePoint document library called Engagement is created in your site. The integration also sets up a folder for each Engagement record.
Step 5: Upload a Document Inside the Model-Driven App
Open an Engagement record in the model-driven app. In the command bar, click Related (or Documents, depending on your layout) to see the Document Associated Grid.
- Click Upload → Upload File.
- Choose a file from your local machine (e.g., a PDF of the engagement contract).
- Confirm. The file appears in the grid immediately.
The document is now stored in SharePoint, but you can also access it from the SharePoint site.
Step 6: Understand the File Structure in SharePoint
Navigate to your SharePoint site and open Site Contents. You’ll see a document library named Engagement.
Inside the library, each Engagement record has a subfolder named after its primary key (not the friendly name). Open the folder corresponding to the record you used – you’ll find the uploaded document there.
This folder-based structure keeps files organized and allows direct SharePoint operations (e.g., co-authoring, metadata updates) outside of Power Apps.
Step 7: Surface Documents on the Main Form (Optional)
It’s more convenient for users to see documents without switching to the Related tab. You can add a Documents subgrid directly on the main form.
- Edit the Engagement Main Form in the maker portal.
- Add a new one‑column tab named Documents.
- Inside the tab, add a Subgrid component.
- Set Show related records to Yes, choose the table Documents (Regarding).
- Select the default view All SharePoint Documents or Active SharePoint Documents.
- Save and Publish.
When you open the form, the Documents tab displays the subgrid with all files for that Engagement record. Users can upload new files directly from the grid.
Security and Performance Notes
- Delegation: When querying documents from a SharePoint library inside Power Apps (canvas apps), delegation limits apply. In model-driven apps, the grid handles this automatically – you can search and sort across thousands of files without issues.
- File Size Limits: SharePoint Online accepts files up to 250 MB by default (can be increased to 2 GB with site collection configuration). For larger files, consider Dataverse file storage or Azure Blob.
- Version History: Every file update creates a new version. You can restore previous versions from SharePoint. This is free and automatically enabled.
- Metadata: You can add custom columns to the document library in SharePoint and later surface them in Power Apps. The document association grid can display those extra fields.
Common Mistakes & Troubleshooting
| Problem | Likely Cause | Solution |
|---|---|---|
| Document grid is empty | SharePoint site not validated | Re-run the Enable Server-Based SharePoint Integration wizard |
| Upload button grayed out | User lacks contribute permissions on the library | Grant at least Contribute access on the SharePoint site |
| “Path not found” error | Document library not fully created | Wait a few minutes and retry. Verify in SharePoint that the library exists |
| Wrong folder structure | Based on Entity was accidentally selected | Remove the association and re-create document management for the table |
| Changes not saved on form | Model-driven app form not published | Publish the form from the maker portal |
Final Recommendation
If your model-driven app stores documents that don’t exceed 250 MB per file and you want low‑cost, versioned storage with full SharePoint integration, this approach is a win. It saves you Dataverse capacity costs and leverages features like metadata, co‑authoring, and retention policies. For extremely large files (e.g., video files, CAD drawings) or when you need to apply Dataverse business rules directly on the file, Dataverse file columns are still the better choice.
In short, use SharePoint for documents that need to be cheap and shared; use Dataverse for files that must be tightly bound to business logic.
References
- Original reference article by Matthew Devaney: How To Setup SharePoint Integration: Model-Driven Power Apps
- Microsoft Learn – Set up SharePoint document management: [Link placeholder – search “Enable SharePoint document management in model-driven apps”]
- Microsoft Learn – Document management settings: [Link placeholder – search “Document management settings model-driven apps”]
Learn how small coding practices—like using descriptive names, flattening conditions, and simplifying logic—can make your apps easier to update and less error-prone.
Move past the gallery and discover the hidden patterns for validation, navigation, and smart submission handling in your data entry forms.
PowerShell unlocks admin capabilities that the Power Platform admin center simply doesn’t offer—from recovering deleted apps to blocking trial licenses. Here’s how to wield them safely.