Canvas Apps Dataverse

How to work with Dataverse Notes in canvas apps

A person writing on a notepad with a pen
A person writing on a notepad with a pen

Introduction to Notes

Notes are an integral part of Dataverse tables. They are used to store notes 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

Notes in canvas apps

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

Viewing existing notes

There are two methods to display notes related to an account:

  1. Use the dot operator:
    galAccounts.Selected.Notes
  2. Using the Notes table:
    Filter(
        Notes,
        Regarding = galAccounts.Selected
    )

Creating a note

To create a note, use either a form connected to the Notes table or use the following Patch statement:

Patch(
    Notes,
    Defaults(Notes),
    {
        Title: "New Note",
        Description: "I am the body of this note",
        Regarding: galAccounts.Selected
    }
)

When using a form, make sure you populate the regarding field with the record you want to link the note to (e.g. the selected account from the gallery of Accounts).

Editing a note

To edit a note, use either a form connected to the Notes table or use the following Patch statement:

Patch(
    Notes,
    galNotes.Selected,
    {
        Title: "New title",
        Description: "I am the new body of this note"
    }
)

Deleting a note

To delete a note, use the following code:

Remove(
    Notes,
    galNotes.Selected
)

As you can see, working with notes in canvas apps is slightly more complicated than in model-driven apps. Next we will look at working with Attachments.

Recent articles

  1. How to work with Dataverse Notes in model-driven apps
  2. Notifications for time entry – a new requirement
  3. Time Entry – A simple solution

4 thoughts on “How to work with Dataverse Notes in canvas apps”

Leave a Reply