-
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…
-
View PDF List attachments and Library files in PDF viewer
The process for viewing SharePoint Library attachments in the PDF viewer has been well documented, but what about SharePoint List attachments ? This blog will discuss a fairly straight-forward method of adding this to the user experience. Firstly, you need a Gallery with the Items (if you only have PDF files, you do not need the Filter). You can put the Name (Text Label with ThisItem.Name ) and possibly an Image control with the Image property of Note that this will not resolve the thumbnail on a mobile device app. Now add an icon (Icon.DocumentPDF is a good one). You are also going to need the ID of the record that the files are attached to. The OnSelect of the icon (do not enter this…
-
Patching a Collection to SharePoint with an attachment on the records
This is something that there is no “standard” way of doing as saving an attachment directly from Power Apps requires an attachment control with either SubmitForm() or Patch(Form.Updates), however often the requirement is for records to be accumulated in a Collection (including possible offline saving) and then bulk updated to SharePoint. The workaround described below only works with a single attachment per record. Nested galleries do not seem to work on this. Firstly you have a Collection with an Attachment on each (or some of) the record/s. Insert a Gallery (you can hide it later) with the Items of the Collection and any other fields you want to Patch on Labels (though this is not strictly necessary). Now…
-
Show size of attachment or uploaded file
Have you ever wanted to show or use the size of an uploaded file – the process is below Attachment Firstly, you need a hidden image control with the Image Then on the OnAddFile (and OnRemoveFile if you want) Then the Label below has the Text Uploaded file A similar, but less complex process – on the OnChange of the AddMediaButton and the Label below All attachments on a record An expansion on #1 above – make a Gallery (called galAttach below) with the Items Now put an Image control in the Gallery (called imAttach below) with the Image You can now hide the gallery You will need to trigger the next piece, so a button with “Size” or…
-
Send selected attachments on an email directly from Power Apps
Have you ever wanted to send only some of the attachments on your record via email to someone? The solution is actually quite straightforward, but requires a bit of trickery not evident in the picture below. The attachment control is a standard item in a form displaying the attachments on a record (I called this one acEmail ) – there are no modifications to it. The check boxes shown however are in a gallery placed “on top” of the attachment control – I called it galAttach here. You may have to adjust the TemplateHeight to get it to “line up” properly with the attachment control. The Items of this gallery are essentially a copy of the data in the attachment control. Two labels…
-
Opening Attachments from Power Apps instead of needing to download.
Option 1 – View mode opening In the example below, the Form is started in Edit Mode, showing a normal attachment control, however once it is switched to view mode, a different attachment list appears with an icon at the right that allows direct opening of the attachment with “one click”. If the file can be opened in a browser (images, PDFs) it will do so, otherwise it will download. So what is going on here? Firstly, a small limitation – the “view mode” list is actually a gallery (which cannot be inserted into the form), so is simply placed in the same location as the Attachment Control. Consequently, if the Form is longer…