1. Upload Files from PowerApps to SQL
My cheat sheet for upload and display files in PowerApps
17 April 2019
• First: I'm not an Azure Expert at all!
• This presentation is more like a cheat sheet if you have Microsoft Azure SQL Server as a database
and want to store files from within Microsoft PowerApps.
• For a Microsoft PowerApps project I created several tables on an Azure SQL Server.
• Documents and images are stored in an Azure Blob Storage Container
• Azure SQL Server with tables of your choice
• Azure Blob Storage Container
Optional: Microsoft Azure Storage Explorer to understand where your files are uploaded to.
What you will find here
• An example of a very simple table “Projects”. Each project has an
• A blob storage container “projects”. This container will have folders
which are named as the IDs of the project ID. The folders are
created during upload.
• PowerApps with an upload functionality for files
• A Gallery with the uploaded files for each project
• PDF-viewer and image control to display the content
3. Azure SQL
Don‘t forget to define a key.
If not you won‘t be able to create
new records in PowerApps
This is where we want to store our
There will be folders underneath.
Folder names = Project.ID
4. Create a
In PowerApps the starting point was
[Create an app] – [Canvas] – [Start with your data]
Here I chose my SQL connector to automatically
build a standard app in Smartphone layout
Also add the
connector to the
Azure Blob Storage
5. Create some
First I created some projects.
Before we navigate from the
browse screen to the details
screen we store the project ID in a
project ID in a
7. Show me the
This screen has some additional fields to see more details.
• ti_filename: a text input control which contains the filename of the selected file and the option to
rename it as a default value.
• lbl_ID_file: Concatenate the project ID (our folder name), add a „/“ and the filename
• lbl_blob: this is our file as a blob
All this fields can be hidden in the published app. It is just to show which content we use for the
8. File Upload
Next we add a button and add
some action to „OnSelect“
The Azue Blob Storage Container
9. Where is the
If you open the Azure Blob Storage Explorer you will see a new folder (our project ID).
This is where we find the file.
10. Show Files
in a Gallery
Items = AzureBlobStorage.ListFolderV2(LookUp(
DisplayName=glb_ProjectID & "/", Id)).value
The command for retrieving the content of a folder is a bit tricky.
At first I expected something like „projects/1“ to look for my
files, but it is all about the Ids within the blob container
Finally I combined all my bits and pieces as one single command
The screenshot on the right has the PDF viewer control.
If you also have images, add the image control and decide based
on the value of „ThisItem.Media.Type“ which to display.