Have you ever wanted to send only some of the attachments on your record via email to someone? The solution is actually quite straightforward, but requires a bit of trickery not evident in the picture below.
The attachment control is a standard item in a form displaying the attachments on a record (I called this one acEmail ) - there are no modifications to it. The check boxes shown however are in a gallery placed "on top" of the attachment control - I called it galAttach here. You may have to adjust the TemplateHeight to get it to "line up" properly with the attachment control.
The Items of this gallery are
acEmail.Attachments
essentially a copy of the data in the attachment control.
Two labels are then inserted into the gallery with ThisItem.Name and ThisItem.Value and then hidden. A checkbox is then inserted (I called mine ckChoose) - it does not need to bound to anything.
Now the email button uses the Office365Outlook Connector (so attach it in your data sources) with the following OnSelect
Office365Outlook.SendEmailV2(
"xxx@yyy.com",
"Subject here",
"Attached are the chosen files",
{
Attachments:
AddColumns(
RenameColumns(
Filter(
galAttach.AllItems,
ckchoose.Value
),
"Value",
"ContentBytes"
),
"odata.type",
""
)
}
)
and it picks the values from the gallery (which has the same values as the attachment control), and attaches the content to the email.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.