Skip to main content

Notifications

Power Apps - Power Apps Pro Dev & ISV
Suggested answer

Attachments from Canvas App to Model Driven App.

Posted on by 189
 

Overview:

I have a solution using a Dataverse table, Power Pages for request forms, and a model-driven app to manage service lines. We are transitioning from Power Pages to a Canvas app to leverage its flexibility for enhanced functionality and visual design.

Context:

We’re starting with a My Requests view in the Canvas app, which allows users to:

  • View the status of their submitted requests.
  • Make modifications if the request hasn’t already been assigned.

One anticipated need is for users to add additional attachments to existing requests. Currently, attachments are handled using the Notes (Annotation) table in Dataverse. Based on my research, the relationship between the Intake Request table and the Notes table is maintained via the Regarding column in the Notes table.

Problem:

When I inspect the Notes table, the Regarding column is blank for all entries. Despite this, attachments are still visible on the related records in the model-driven app. I am unable to determine how this association is being established by the developers who originally configured the solution using Power Pages.

In my Canvas app, I have an Attachment control that allows multiple files. However, when I attempt to attach a file and save the form, the file doesn’t appear in the expected location. Instead, in the Intake Request table, I see an attachment icon with a GUID value, but I can’t trace where the actual file is stored or how it’s linked.

Goal:

I need to replicate the existing attachment behavior from Power Pages in my Canvas app. I want any additional attachments uploaded via the Canvas app to appear correctly in the Notes section of the related Intake Request record in the model-driven app.

In the screenshot below, the existing attachment (uploaded on 11/6) is visible, but the new attachment I attempted to add today (11/18) is missing. My goal is for both files to show up here consistently.

  • Suggested answer
    Mark Nanneman Profile Picture
    Mark Nanneman 329 on at
    Attachments from Canvas App to Model Driven App.
    Hello Shonda,

    The "Regarding" column of the Annotations table is a special polymorphic column--it's not like a normal lookup column that goes to just one table so it won't render normally.  If you open the "Note" record in a Model-Driven App, the form will show you the record it's associated with (Regarding/ObjectID) in the Regarding Field and you can click into it.  Further down I'll show you how you can visualize the "Regarding" record in a list view for Annotations/attachments.

    Why not just use Model Driven Apps?
    This might be a silly question--but are you sure you have to have the users uploading the file attachments/notes in the canvas app?  Have you considered making a Model-Driven App that the user can manage notes / timeline on for their Requests?  Generally Model-Driven Apps are quicker and easier to make and manage than a Canvas App.

    You could also consider having the canvas app auto open a link to the their request record in a model driven app, or email them a link to their record in the model driven app later with instructions to use it to upload files/notes.

    How to work with Notes in Canvas Apps:

    That said you can handle the notes in a canvas app like you said by using the form w/ attachments card, but you can also display them in a gallery and you can also create new notes / edit existing ones using the Patch() function.

    The only trick is using the "AsType()" function on the Regarding column to filter it as the table type you want.
    E.g. for notes/attachments on Contacts:

    Filter(Notes,AsType(Regarding,Contacts).Contact = vSelContact.Contact)

    How to make a Model-Driven App View showing which records a note/file is saved to:

    If you want to create a filtered view to visualize the a list of annotations and what record they're attached to, you can do this by creating a custom view using "Related" columns.

    1. Goto Views

    2. Search for a Name field on your desired Regarding Table under "Related"
     

    3. Add A filter (optional) if you only want to see notes regarding a certain table

    4.  Save and Publish--now you have a view showing the records that are linked to your notes
     
    you can use this view in a Model-Driven App, Portal Page or Canvas App now.

    If this helped you, please click "Does this answer your question" and give it a like to help others in the community (+ close the ticket)!

    Power Platform Developer | LinkedIn: Mark Nanneman | Blog: Power Stuff  | YouTube: Mark's Power Stuff  | Buy me a coffee

     

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

November 2024 Newsletter…

November 2024 Community Newsletter…

Community Update Oct 28…

Power Platform Community Update…

Tuesday Tip #7 Community Profile Tips…

Welcome to a brand new series, Tuesday Tips…

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 143,532

#2
RandyHayes Profile Picture

RandyHayes 76,308

#3
Pstork1 Profile Picture

Pstork1 64,050

Leaderboard