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
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
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)
I am also attaching the screenshot of expression I wrote for making a collection (Please see attached image).
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
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
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😞
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,
stampcoin
17
mmbr1606
15
Super User 2025 Season 1
ankit_singhal
11
Super User 2025 Season 1