Canvas Apps Dataverse

How to work with Dataverse Attachments in canvas apps

A bunch of locks attached to a fence
A bunch of locks attached to a fence

Introduction to Attachments

Attachments are an integral part of Dataverse tables. They are used to store files linked to any record e.g. an account or a contact. Some out-of-the-box tables come with attachments enabled, which in turn enables notes and files. For custom tables, there is an option to enable attachments.

Enabling attachments for a custom Dataverse table
Enabling attachments for a custom Dataverse table

Attachments in canvas apps

Working with attachments in canvas apps isn't too bad. It isn't as easy in a model-driven app though.

Viewing existing attachments

To display attachments related a record like an account, use the attachment control. Follow these steps for the best way to display existing attachments:

  1. Add the form control in the canvas app
  2. Connect it to a table that has attachments enabled (e.g. Accounts)
  3. Go the "Fields" property of the form control and click on "10 selected" (or how many ever fields get selected by default)
  4. Click on Add field, search for Attachment, select it, and click on Add

    Add the attachment field to the form
    Add the attachment field to the form
  5. Set the Default mode of the form to Edit
  6. Set the Item property of the form to galAccounts.Selected
  7. The attachments should show up

    Viewing existing attachments for the selected account
    Viewing existing attachments for the selected account

Adding a new attachment

You can use the same setup as above to add a new attachment. Click on "Attach file", select a file and then click on a button that will submit the form.

Deleting an existing attachment

You can use the same setup as above to delete an attachment as well. Click on the X next to an attachment and then click on a button that will submit the form.

As you can see, working with attachments in canvas apps is slightly more complicated than in model-driven apps.

Recent articles

  1. How to work with Dataverse Attachments in model-driven apps
  2. How to work with Dataverse Notes in canvas apps
  3. How to work with Dataverse Notes in model-driven apps

3 thoughts on “How to work with Dataverse Attachments in canvas apps”

Leave a Reply