Hi @Anonymous ,
Could you please share a bit more about your scenario?
Do you want to attach these images within the Gallery as attachments of the Outlook email?
I assume that you store the capture image from your Camera control into a collection, then bind the collection to the Gallery, is it true?
I have made a test on my side, please consider take a try with the following workaround:
Set the OnSelect property of the Camera control to following:
Collect(
ImageCollection,
{
FileName: "Picture"&CountRows(ImageCollection)&".jpg",
FileContent: Camera1.Photo
}
)
Set the Items property of the Gallery to following:
ImageCollection
within the Gallery, set the Image property of the Image control to following:
ThisItem.FileContent
After that, modify your email function as below:
If(
Dropdown2.Selected.Value = "Safety " || Dropdown2.Selected.Value = "Quality ",
Office365Outlook.SendEmailV2(
"Gggg_Ghhh@cat.com",
Dropdown2.Selected.Value,
"<table><tr><td><b>Observation:</b></td><td>" & Message_TextInput &"</td></tr></table>",
{
Bcc: "",
Importance: "Low",
Attachments: ForAll( // Add formula here
Gallery1.AllItems, // Gallery1 represents the Gallery in your app, where you display your captured image
{
Name: FileName,
ContentBytes: Image1.Image,
'@odata.type' : ""
}
)
}
)
)
or
If(
Dropdown2.Selected.Value = "Safety " || Dropdown2.Selected.Value = "Quality ",
Office365Outlook.SendEmailV2(
"Gggg_Ghhh@cat.com",
Dropdown2.Selected.Value,
"<table><tr><td><b>Observation:</b></td><td>" & Message_TextInput &"</td></tr></table>",
{
Bcc: "",
Importance: "Low",
Attachments: ForAll( // Add formula here
ImageCollection,
{
Name: ImageCollection[@FileName],
ContentBytes: ImageCollection[@FileContent],
'@odata.type' : ""
}
)
}
)
)
More details about sending an email along with attachments, please check the following article:
https://docs.microsoft.com/en-us/powerapps/maker/canvas-apps/connections/connection-office365-outlook#send-a-message-with-an-attachment
Best regards,