Skip to main content

Notifications

Community site session details

Community site session details

Session Id : 3xL+aJG8YsrydsVo0pteoR
Power Apps - Building Power Apps
Answered

Viewing multiple attachments from Dataverse table in Canvas App

Like (1) ShareShare
ReportReport
Posted on 30 Aug 2024 12:54:46 by 49
Hi!
 
I followed with video to implement multiple attachments control for my Dataverse table in Canvas App:
 
So, I have a table Signal and 1:N table Signal AttachmentSignal Attachment table has a lookup to Signal and field of type File.
 
 
In Canvas app on New/Edit screen I have a Attachments control (outside of the Form) to upload attachments, and a Gallery to view file names and remove attachments:
 
I have code AttachmentControl.OnAddFile (to add files to colSignalAttachments collection, marked as IsNew), Gallery.RemoveIcon.OnSelect (to mark item in colSignalAttachments as IsDeleted) and Gallery.RestoreIcon.OnSelect (to remove IsDeleted mark).
 
In Canvas app I'm able to upload attachments and save them. If I open my Signal Attachment table in MDA I can see attachments and view it without any issue.
 
 
 
SaveButton.OnSelect:
ForAll(
    Filter(colSignalAttachments, IsDeleted) As ThisAttachment,
    RemoveIf('Signal Attachment', 'Signal Attachment' = ThisAttachment.ID);
);
ForAll(
    Filter(colSignalAttachments, IsNew) As ThisAttachment,
    Patch(
        'Signal Attachment',
        Defaults('Signal Attachment'),
        {
            Signal: ctxViewSignal,
            Attachment: {
                FileName: ThisAttachment.DisplayName,
                Value: ThisAttachment.Value
            }
        }
    )
);
 
However, I cannot download attachments on my View screen. 
 
AttachmentControl.Items:
ForAll(
    Filter(
        'Signal Attachment',
        Signal.Signal = ctxViewSignal.Signal
    ).Attachment,
    {
        DisplayName: ThisRecord.Attachment.FileName,
        Value: ThisRecord.Attachment.Value
    }
)
 
It shows my files names correctly, but on download I receive "BlobNotFound":
 
 
The only noticible difference between my app and the video guide is that I cannot map DisplayName and Value field on the Attachment Control Properties pane (there are no such properties).
Categories:
  • Verified answer
    IuriiPalchuk Profile Picture
    49 on 04 Sep 2024 at 17:19:14
    Viewing multiple attachments from Dataverse table in Canvas App
    Instead of using Attachments control, I created a Gallery with modern buttons with icons to download files via Dataverse API. And it looks much nicer with file type icons:
     
     
    How to download file from Dataverse File column using Dataverse API:
    How to show file type icons in gallery:

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

Understanding Microsoft Agents - Introductory Session

Confused about how agents work across the Microsoft ecosystem? Register today!

Warren Belz – Community Spotlight

We are honored to recognize Warren Belz as our May 2025 Community…

Congratulations to the April Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 146,763 Most Valuable Professional

#2
RandyHayes Profile Picture

RandyHayes 76,287 Super User 2024 Season 1

#3
Pstork1 Profile Picture

Pstork1 66,091 Most Valuable Professional

Leaderboard
Loading started