Using Notes and Attachments in forms

Loading

In Power Pages (formerly known as Power Apps Portals), the ability to add Notes and Attachments to forms is essential for building interactive, data-rich, and user-friendly experiences. This feature allows users to upload documents, images, and comments related to records stored in Microsoft Dataverse directly from a portal interface.

This guide explains how Notes and Attachments work in Power Pages, how to enable them in forms, and best practices to ensure a smooth and secure user experience.


1. What are Notes and Attachments in Power Pages?

  • Notes (also known as annotations): These are text-based entries that can include file attachments. They provide contextual information about a record.
  • Attachments: Files that are uploaded and stored as part of a note, such as PDFs, images, Word documents, etc.

When users submit a form on a Power Pages site, they can optionally include Notes and Attachments if the functionality is enabled. These are stored in the Dataverse as part of the related entity record.


2. Enabling Notes and Attachments in a Power Pages Form

To allow notes and file uploads in a form on your Power Pages site, follow these steps:

Step 1: Enable Notes in the Dataverse Table

  1. Go to make.powerapps.com.
  2. Select Tables from the left navigation.
  3. Choose the table (entity) you want to enable Notes for.
  4. Click on Settings for the table.
  5. Under Advanced options, toggle Enable attachments (including notes and files) to ON.
  6. Save the changes.

Note: This step is essential. Without enabling notes at the Dataverse level, the rest of the setup won’t work.


Step 2: Configure the Form in Power Pages

  1. Go to Portal Management App or Power Pages Design Studio.
  2. Navigate to Entity Forms (now called Basic Forms).
  3. Select or create the form you want to configure.
  4. Scroll down to the Additional Settings section.
  5. Enable the Attach File or Show Notes options.
  • Attach File: Enables users to upload files directly.
  • Show Notes: Allows users to add text-based notes and optionally include file uploads.
  1. Save and Publish the form.

Step 3: Add the Entity Form to a Web Page

  1. Go to your Power Pages Design Studio.
  2. Choose the page where you want the form.
  3. Insert the Basic Form component.
  4. Select the appropriate form and check that the Notes and Attachments functionality is visible in preview mode.
  5. Save and sync the site.

3. How Notes and Attachments Work on the Frontend

Once the above setup is complete, users will see:

  • A text field to enter a note.
  • An option to Attach a file (via file picker).
  • A list of previous notes (if any) with timestamps and uploader details.
  • Optionally, a download link for previously uploaded attachments.

Each file or note is tied to the parent record being created or updated via the form.


4. File Size and Type Limitations

Power Pages supports default Dataverse file size and type constraints:

  • Maximum file size: 128 MB per file (as per Dataverse default; can be configured with premium storage).
  • Allowed file types: Based on Dataverse security and content filtering. You can customize allowed file extensions.

To restrict or allow certain file types, consider using Portal Site Settings like:

  • Notes/Attachments/AllowMimeTypes
  • Notes/Attachments/DisallowMimeTypes
  • Notes/Attachments/FileSizeLimit

5. Portal Site Settings for Notes and Attachments

Here are some useful portal site settings that help control how notes and attachments work:

Setting NamePurposeExample
Notes/Attachments/EnabledEnable or disable attachmentstrue
Notes/Attachments/AllowMimeTypesAllow only specific MIME typesimage/jpeg,application/pdf
Notes/Attachments/DisallowMimeTypesBlock specific MIME typesapplication/x-msdownload
Notes/Attachments/FileSizeLimitMaximum size in KB5120 (5MB)

These are added in the Portal Management App under Site Settings.


6. Managing and Viewing Notes in Dataverse

To view the notes or attachments uploaded via the portal:

  1. Go to Power Apps Maker.
  2. Open the relevant table.
  3. Open a record.
  4. Scroll to the Timeline section where notes and files are stored.
  5. You’ll see a list of all annotations (notes), including attachments.

You can also use Power Automate to trigger workflows when a note is added (e.g., send an email, log the upload, move files to SharePoint).


7. Best Practices for Using Notes and Attachments

Enable Security Roles

Ensure that only users with proper roles (authenticated users) can upload files. Assign proper Web Roles and permissions.

Limit File Types

Prevent harmful files by setting MIME-type restrictions in portal site settings.

Monitor Storage

Each attachment consumes Dataverse storage. Regularly audit large uploads and clean old or irrelevant files.

Use for Document Management

Leverage notes for collecting supporting documents like ID proof, agreements, resumes, images, etc.

Avoid Anonymous Uploads

Disable notes for anonymous users unless necessary to avoid spam and abuse.


8. Advanced Use Case – Show Notes in Custom Pages

You can also render a list of uploaded notes using Liquid code on a Power Pages page. Here’s an example:

{% assign notes = entities.annotation | where: "objectid.id", request.params.id %}
<ul>
{% for note in notes %}
<li>
{{ note.notetext }} -
<a href="{{ note.documentbody | entity_url: note.mimetype }}">{{ note.filename }}</a>
</li>
{% endfor %}
</ul>

This will display a list of all notes for the record with clickable links to download attachments.


9. Security Considerations

  • File Scanning: Power Pages does not automatically scan attachments. Use Microsoft Defender or third-party tools to monitor uploaded files.
  • Record Ownership: Each note inherits the owner of the parent record unless reassigned.
  • Data Retention: Consider policies for data retention and GDPR compliance.

Leave a Reply

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