Hi all,
I've developed a Power App for logging issues in a Data Centre, users can submit a picture utilising the Add Picture control.
The issue I'm facing is that if the user does not attach a picture, the email does not trigger.
I've tried to use a condition but I'm still fairly new to Power Apps and cannot figure out how to get it to work without the attachment.
Here is the current formula:
If(
IsBlank(imgAttachEmail.Image),
Office365Outlook.SendEmailV2(
"Test@TestDomain.Com",
"New Issue logged via app - With Image",
"<b>Name of Reporter:</b>" & " " & TextInput_Name.Text & "<br>" & "<b>Reporter Email:</b>" & " " & TextInput_Email.Text & "<br>" & "<br>" & "<b>Location of issue:</b>" & " " & TextInput_Location.Text & "<br>" & "<b>Subject of issue:</b>" & " " & TextInput_Subject.Text & "<br>" & "<br>" & "<b><u>Description of issue</u></b>" & " " & RichTextInput_Description.HtmlText,
{
Attachments: {
Name: ambFileAttach.FileName,
ContentBytes: imgAttachEmail.Image,
'@odata.type': ""
}
}
),
Office365Outlook.SendEmailV2(
"Test@TestDomain.com",
"New Issue logged via app",
"<b>Name of Reporter:</b>" & " " & TextInput_Name.Text & "<br>" & "<b>Reporter Email:</b>" & " " & TextInput_Email.Text & "<br>" & "<br>" & "<b>Location of issue:</b>" & " " & TextInput_Location.Text & "<br>" & "<b>Subject of issue:</b>" & " " & TextInput_Subject.Text & "<br>" & "<br>" & "<b><u>Description of issue</u></b>" & " " & RichTextInput_Description.HtmlText
);
The issue I get with it set up like this is that it will send the email with no attachment, whether I attach an image or not.
If I switch the attachment part of the formula to the "else" value, it won't work unless there is an attachment.
Any help is greatly appreciated!