Hello,
I would like to
Sending Emails works fine, but to get the attachment produces an error.
I would not like to do a workaround with flow!
SharePoint Library is called "Export" and added as connection.
ClearCollect(FinalAttachments, {Name:Export.Name, ContentBytes:FileContent,'@odata.type':""})
;
Office365.SendEmailV2(
"My@email.com",
"Test Subject",
"Test Body",{Attachments: Name: FinalAttachments.Name,ContentBytes:FinalAttachments.ContentBytes, '@odata.type':""})
Mainly I get the error that contentbyte 'blob' is expected and not record...
Isn't there an easy way to get the file directly from the library connection instead of a collection? And really, what is it about contentbyte??? I cannot find any reasonable description in the microsoft docs about it...
That code is for adding attachments, not gallery items (which you cannot do)
Is your code usable when attaching multiple documents from a gallery? I want to attach every file in the gallery, or just use the filter that's in that gallery, but I'm not sure how to not use a selected item.
Office365Outlook.SendEmailV2(
DataCardValue_EmailSendTo.Text,
DataCardValue_EmailSubject.Text,
DataCardValue_EmailBody.Text,
{
Cc: Coalesce(DataCardValue_EmailCC.Text, ""),
Attachments:
AddColumns(
RenameColumns(
PODocuments_Gallery.AllItems,
"Value",
"ContentBytes"
),
"@odata.type",
""
)
}
);
I get multiple errors with that code, including "The specified column 'Value' does not exist". Can you point me in the right direction?
Hi there, even im stuck with same issue, reason being im not using flow, I have list of files saved in SP library, and im not sure how to send the correct file. Can anyone suggest if we can send only selected files in flow ?
Unfortunately, it is not clearly possible, if you collect the Library, you will not see the actual content of the file in any of the fields.
You asked a question and I tried to answer it.
Hi @WarrenBelz ,
I could not get your solution to work, so the topic is still open.
Clearly as you can add a SharePoint Library as DataSource in PowerApps it must be possible to somehow get hold of the content directly without adding it to a collection, renaming columns and setting content bytes and all the other weird stuff...
Hi @FastTrack ,
Just checking if you got the result you were looking for on this thread. Happy to help further if not.
Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.
I was simply correcting the syntax of your code, which is referring to an attachment.
I do not believe there is a way of "pulling" file content from a SharePoint Library and attaching it without a Flow as the Power Apps connection to the library only includes the metadata, not the content of the file.
Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.
Thank you, but the Attachment is in a dedicated SharePoint library, always the file "mail.jpg" in a unique folder of this library. Files are not in a gallery of my PowerApps
Hi @FastTrack ,
Try this
Office365.SendEmailV2(
"My@email.com",
"Test Subject",
"Test Body",
{
Attachments:
AddColumns(
RenameColumns(
Gallery1.Selected.Attachments,
"Value",
"ContentBytes"
),
"@odata.type",
""
)
)
}
Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.
WarrenBelz
637
Most Valuable Professional
stampcoin
570
Super User 2025 Season 2
Power Apps 1919
473