Data,  Functionality

Save Power Apps SharePoint offline data including Attachments without a Flow

Have you wanted to save offline data in SharePoint, but also needed to include attachments. Here is a way to save, retreive and upload this data using only Power Apps. Note this example addresses new records only.

Firstly you need a normal Edit Form (classic example here) with an attachment control (example named acAttachments). Data is entered as usual. 

Now you need a Gallery (galAttachments – which you can hide) – with the Items property

In the gallery are two controls – a Text Label lblAttachName with the Text property

and an Image Control imgAttachContent with the Image property

The Image control is needed to resolve the attachment content to the actual file content rather than the format an attachment control uses to reference them.

When you are saving the offline form, it is to a collection – example below colOffline. Add your other fields as required. This example first tests for a connection and submits the form if one exists – you can call the local offline file whatever you want

Now when you need to upload all of the offline records to your SharePont list when back online – at App OnStart

Then to upload the saved files

You should find all the offline records complete with any attachments now in your SharePoint list.

It is also good to have a label on the screen with the Text

and the Visible

You could also have the upload button having the same Visible

Leave a Reply

Your email address will not be published. Required fields are marked *