Nearly all my Canvas-Power-App-with-SharePoint solutions follow the same architecture:
- Initial Setup
- SharePoint – Construct initial SharePoint schema to feed the Power App and to store production records. This is comprised of several lists and libraries. This set of tables is the equivalent to a SQL database
- Columns
- Use only Single/Multi Lines of Text, Date, and Number columns
- Choice columns should only be used in scenarios where you need multiple items to be stored in the same list, otherwise consider creating a sub list to store this data
- Main list(s): In your development SharePoint site, create the main SharePoint lists or libraries where the app will be saving data. Often it is just one list storing records generated by the Power App.
- System list(s)
- Every canvas Power App typically needs one ‘system settings’ list to store simple data points
- Any drop down or similar control that the user chooses from needs to point to a system SharePoint list
- Sub lists or libraries, if needed
- These usually contain multiple records per main list record
- For files, consider using a library instead of list attachments
- These usually contain multiple records per main list record
- Columns
- In your developer environment, create a solution and add the following:
- Environment variables
- For every site your app looks to, create an environment variable, and set the current value to your developer site
- Likewise, for every list your app needs, create an environment variable with the current value set to the proper list
- Use an intelligent naming scheme here to help match a particular site or list to the name of your environment variable
- Power App
- Create the app inside the solution and add the data source via environment variables using the Advanced section on the right-hand side of the Power App studio to select the environment variable SharePoint site, and then do the exact same for each list
- Environment variables
- SharePoint – Construct initial SharePoint schema to feed the Power App and to store production records. This is comprised of several lists and libraries. This set of tables is the equivalent to a SQL database
- Development
- Build your app
- Deployment to the Production or Testing environment
- Create a copy of all lists and libraries created in dev to your production SharePoint site
- Use the ‘Create List from Existing List’ feature to quickly build these
- Index any column used in a Filter() or LookUp() function
- Edit each environment variable and remove the current value
- Export the solution as a Managed solution
- Import into your production environment and set the environment variables to the production site(s) and lists
- Open the new solution and share the app(s) and any flows, go into SharePoint and share the lists, etc.
- Create a copy of all lists and libraries created in dev to your production SharePoint site
This design approach can handle complex scenarios and easily scales to multiple environments.