Skip to main content

Notifications

Community site session details

Community site session details

Session Id :
Power Apps - Microsoft Dataverse
Answered

How to access the Content stored in CDS Attachments

(0) ShareShare
ReportReport
Posted on by

Hello, 

I would like to know how can we access the Content stored in CDS attachements ? 
For intance, I am trying to store a PDF or Image file(Any image file type) in CDS through powerApps and after storing that particular file in CDS I want to access that file through flows/PowerApps and send that stored file as an attchement in E-mail or upload that file on OneDrive. 

Now in CDS, All I can see is just IDs and version numbers.
I have manged to get this Content URI
appres://blobmanager/8964d785a7b04ba89466245be0619629/2
How can I access that uploaded file through this URI and then send it as an attachment in E-mail or Upload it on OneDrive.
I have attached the screenshots of PowerApps and Flows we are using in this case. 

Swift Response is appreciated.

Thank You.
Kind Regards,
Ali Nawaz

Categories:
  • BrucePain Profile Picture
    12 on at
    Re: How to access the Content stored in CDS Attachments

    Is there a way I can show or launch this attachment in a browser? I don't want to download it, just want the users to directly launch it in a browser

  • Community Power Platform Member Profile Picture
    on at
    Re: How to access the Content stored in CDS Attachments

    Hi @v-xida-msft,

     
    Let me elaborate it more.

     

    I am trying to send multiple attchments (Through CDS attachements ) in Email thourgh Office 365 SendMail function.
    When attaching collection in Attachment section of  send email function i am receving an Error. (Find Attched Image)

    Blob_error.png

    I am also attaching the screenshot of expression I wrote for making a collection (Please see attached image).

    Screenshot_1.png
    I have followed this tutorial for sending multiple attachments, still no Luck.
    https://www.youtube.com/watch?v=V3feURQfY3M

    I am hoping for a swift response. 

    Regards,
    Ali Nawaz

  • Community Power Platform Member Profile Picture
    on at
    Re: How to access the Content stored in CDS Attachments

    Hello Kris Dai,

    Bundle of thanks for the solution you mentioned in your last reply, it worked like magic. 
    Now there's an issue I'm having with this code. I want to send multiple attachments in Email. 
    The solution you provided is working great in case of single attachment but for multiple attachments i am still looking for a workaround. 

    I tried to use "For All" function but I received many Errors in it. 
    And I also tried to pass collection to Attachments attribute in the SendEmail function of office 365 but got many errors, if you can guide me through with "For All" function or any other workaround it will be highly appreciated. 

    Please advise. 

    Regards,
    Ali Nawaz

  • Verified answer
    v-xida-msft Profile Picture
    on at
    Re: How to access the Content stored in CDS Attachments

    Hi @Anonymous ,

    Do you want to send the uploaded attachment files within your CDS Entity along with an email?

    Do you want to use MS Flow to achieve your needs?

     

    If you want to use MS Flow to receive the passed Attachment file name and Attachment file content, then send an email/create a file in OneDrive folder, I afraid that Microsoft Flow could not achieve your needs.

    The result (appres://blobmanager/8964d785a7b04ba89466245be0619629/2) the First(DataCardValue4_1.Attachments).value formula returns is not valid Binary data, which could be used as the File content within the "Create file" action of your flow.

     

    Actually, if you want to send an email with the uploaded file as attachment, you could achieve your needs within your app directly.

    When you attach a file to a record using Attachments control within your app, when you edit the record, the uploaded file would be displayed within the Attachments Data card.

    I have made a test on my side, please take a try with the following workaround (send an email along with the uploaded file😞7.JPG

    within your Edit screen, add a "Send Email" button, set the OnSelect property to following:

    Office365.SendEmail(
    "Test1@xxxxxx.onmicrosoft.com", /* <-- Email , type your own email address here */
    "PowerApps test", /* <-- Subject */
    "This is a test", /* <-- Email Body */
    {
    Attachments: Table({Name: First(DataCardValue9.Attachments).Name, ContentBytes: First(DataCardValue9.Attachments).Value, '@odata.type':""})
    }
    )

    On your side, you should type:

    Office365.SendEmail(
     "Test1@xxxxxx.onmicrosoft.com", /* <-- Email , type your own email address here */
     "PowerApps test", /* <-- Subject */
     "This is a test", /* <-- Email Body */
     {
     Attachments: Table({Name: First(DataCardValue4_1.Attachments).Name, ContentBytes: First(DataCardValue4_1.Attachments).Value, '@odata.type':""})
     }
    )

     

    If you want to create a file in your OneDrive folder based on the uploaded attachment file, I think you could consider take a try to create a custom connector to achieve your needs.

    Please check and see if the following blog video would help in your scenario:

    https://repointtechnologies.com/saving-images-from-powerapps-to-sharepoint/

    https://www.youtube.com/watch?v=mp-8B1fLrqs&feature=youtu.be

    Note: The output format of Add Picture control is same with that of Attachments control, so you could use above solution to achieve your needs.

     

    Best regards,

     

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

🌸 Community Spring Festival 2025 Challenge Winners! 🌸

Congratulations to all our community participants!

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 > Power Apps - Microsoft Dataverse

#1
stampcoin Profile Picture

stampcoin 17

#2
mmbr1606 Profile Picture

mmbr1606 15 Super User 2025 Season 1

#3
ankit_singhal Profile Picture

ankit_singhal 11 Super User 2025 Season 1

Overall leaderboard

Featured topics