File Attachment on Basic(Entity) Form in PowerApps Portal

Introduction: In this blog, we will understand how to enable file attachment on a basic(entity) form in the PowerApps portal.

This blog covers below topics:

  1. Overview of the “Attach a file” option and attribute details related to it.
  2.  Storing File Attachment in Notes
  3. Storing files in Azure Blob Storage
  4. Allow only PDF files for Upload

Steps to be followed:

  1. Open the Portal Management App.
  2. Open the entity form on which you want to enable file attachment.
  1. Go to “Addition Settings” tab
  • Attach File: Enable Attach File option.
  • Attach File Storage Location: Select the Attach file storage Location you can store the file as a Notes attachment or in Azure Blob storage.
  • Attach File Save Option: Select Notes or Portal Comments to save file attachments. For notes attachments, select Notes.
  • Accept MIME Types: specify a list of accepted MIME types.
  • Allow Multiple Files: Select this if you want to allow multiple files to upload.
  • Accept File Types: This option is available only when using the Portal Comment option for Attach File Save Option. Allows you to specify a list of accepted file types.
  • Label: You can specify the custom label for File Attachment.
  • Attach File Required: Select this to make it required.
  • Required Error Message: You can specify a custom error message for the required file error.
  • Restrict Files To Accepted Types: Select this if you want to restrict the file to the selected type only.
  • File Type Error Message: You can specify a custom error message if a user uploads an incorrect file type.
  • Maximum File Size (in kilobytes): Specify the maximum size of a file that can be attached.
  • File Size Error Message: You can specify a custom error message if a user uploads a large file than specified.

Example for storing File Attachment in Notes

  • Select “Note Attachment” as “Attach File Storage Location“.
  • Select “Notes” as “Attach File Save Option“.
  • Save the record and go to your portal you should see the “Upload files”(Attach a file) option.
  • After uploading files you can see those files in the “Notes” section.

Example for storing files in Azure Blob Storage

  • Select “Azure Blob Storage” as “Attach File Storage Location“.
  • Select “Notes” as “Attach File Save Option“.
  • Save the record, go to your portal and upload the file.
  • You can see that the File is stored in Azure Blob storage.

Allow only PDF files for Upload

  • Enter “application/pdf” in Accepted MIME Types.
  • Select the “Restrict Files to Accepted Types” option.
  • Enter a custom error message in the “File Type Error Message” field that will come when a user uploads any other file type.
  • save the record, go to your portal and upload any other file type than PDF.
  • You can see your custom error message will popup.
  • When the user will upload PDF files they will get uploaded successfully as shown below.  

POINTS TO BE NOTED:

  1. Entity (Table) must be enable for attachments. (Enable Attachments)
  1. User must have entity permission for notes(annotations).

Read my blog on how to configure Azure Storage in PowerApps Portal:

Leave a Reply

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