cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
thunter
Post Prodigy
Post Prodigy

Attachment Control

I am trying to use the Attachment function so users can send an attachement with an email. But I am getting errors in my formula. Any ideas? I did some more hovering over the formula and it gave me some more errors to look at. Thank you!!

“Missing column. Your formula is missing a column ‘Attachemnts.ContentBytes’ with a type of ‘Blob’”

“The function ‘AddColumns’ has some invalid arguments”

 

attachmentfunction1.png

1 ACCEPTED SOLUTION

Accepted Solutions

Hi @thunter ,

The Attachments need to go after the body (not before it). Also you do not need IsHtml in V2 of SendEmail

Office365.SendEmailV2(
   "xxxx@xxxx.com",
   "New Ticket" & " - " & CategoryDD.SelectedText.Value & " - " & PriorityDD.SelectedText.Value,
   "<b>Date Created: </b>" & DateCreatedValue & "<br>" &"<b>Ticket Submitted By: </b>" & NameText & 
   "<br>" & "<b>Email: </b>" & EmailText & "<br>" & "<b>Priority: </b>" & PriorityDD.SelectedText.Value & 
   "<br>" & "<b>Category: </b>" & CategoryDD.SelectedText.Value & "<br>" & "<b>Subject: </b>" & 
   SubjectText & "<br>" & "<b>Description of Issue: </b>" & DescriptionText & "<br>",  
   {
      Attachments: 
      AddColumns(
         RenameColumns(
            AttachmentBox.Attachments,
            "Value", 
            "ContentBytes"
         ), 
         "@odata.type", 
         ""
      )
   }
);
SubmitForm(NewTicketForm);
ResetForm(NewTicketForm);
Navigate(HomeScreen, ScreenTransition.Cover)

 

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.

View solution in original post

9 REPLIES 9
WarrenBelz
Super User III
Super User III

Hi @thunter ,

What is the name of your Attachment Control? You need to put that where you have Attachment Control

You have also misspelt RenameColumns

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 

AttachmentControl is the name of my control. 

attachmentcontrol2.png

@thunter ,

Did it work with the spelling correction? I just did a test here with

Office365Outlook.SendEmailV2(
   User().Email,
   "Test Attach",
   "Here they are",
   {
      Attachments: 
      AddColumns(
         RenameColumns(
            AttachmentsControl.Attachments,
            "Value",
            "ContentBytes"
         ),
         "@odata.type",
         ""
      )
   }
)

and received the mail back with attachments.

 

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 

Yes, the misspelling correction fixed the issue. Now I am trying to add the attachment part of the formula to my original send email formula now that I am using an attachment but getting errors. I am thinking it is with brackets or parenthesis but not sure. Can you spot the error? Thanks!

Office365.SendEmailV2("xxxx@xxxx.com","New Ticket" & " - " & CategoryDD.SelectedText.Value & " - " & PriorityDD.SelectedText.Value,{Attachments: AddColumns( RenameColumns(AttachmentBox.Attachments,"Value", "ContentBytes"), "@odata.type", "") )},  "<b>Date Created: </b>" & DateCreatedValue & "<br>" &"<b>Ticket Submitted By: </b>" & NameText & "<br>" & "<b>Email: </b>" & EmailText & "<br>" & "<b>Priority: </b>" & PriorityDD.SelectedText.Value & "<br>" & "<b>Category: </b>" & CategoryDD.SelectedText.Value & "<br>" & "<b>Subject: </b>" & SubjectText & "<br>" & "<b>Description of Issue: </b>" & DescriptionText & "<br>", {IsHtml: true});

SubmitForm(NewTicketForm);
ResetForm(NewTicketForm);
Navigate(HomeScreen, ScreenTransition.Cover)

 

attachmentcontrol3.png

@WarrenBelz 

Okay, I fixed the formula now and have no errors and I can add attachment and click to submit email. However, the email has no attachment. I looked in the attachment collection and I see the attachment so not sure why it didn't come through on email.

attachmentcontrol4.png

Office365.SendEmailV2("xxxx@xxxx.com","New Ticket" & " - " & CategoryDD.SelectedText.Value & " - " & PriorityDD.SelectedText.Value, {Attachments: AddColumns( RenameColumns(AttachmentBox.Attachments,"Value", "ContentBytes"), "@odata.type", "") };

"<b>Date Created: </b>" & DateCreatedValue & "<br>" &"<b>Ticket Submitted By: </b>" & NameText & "<br>" & "<b>Email: </b>" & EmailText & "<br>" & "<b>Priority: </b>" & PriorityDD.SelectedText.Value & "<br>" & "<b>Category: </b>" & CategoryDD.SelectedText.Value & "<br>" & "<b>Subject: </b>" & SubjectText & "<br>" & "<b>Description of Issue: </b>" & DescriptionText & "<br>",  {IsHtml: true});

SubmitForm(NewTicketForm);
ResetForm(NewTicketForm);
Navigate(HomeScreen, ScreenTransition.Cover)

Hi @thunter ,

The Attachments need to go after the body (not before it). Also you do not need IsHtml in V2 of SendEmail

Office365.SendEmailV2(
   "xxxx@xxxx.com",
   "New Ticket" & " - " & CategoryDD.SelectedText.Value & " - " & PriorityDD.SelectedText.Value,
   "<b>Date Created: </b>" & DateCreatedValue & "<br>" &"<b>Ticket Submitted By: </b>" & NameText & 
   "<br>" & "<b>Email: </b>" & EmailText & "<br>" & "<b>Priority: </b>" & PriorityDD.SelectedText.Value & 
   "<br>" & "<b>Category: </b>" & CategoryDD.SelectedText.Value & "<br>" & "<b>Subject: </b>" & 
   SubjectText & "<br>" & "<b>Description of Issue: </b>" & DescriptionText & "<br>",  
   {
      Attachments: 
      AddColumns(
         RenameColumns(
            AttachmentBox.Attachments,
            "Value", 
            "ContentBytes"
         ), 
         "@odata.type", 
         ""
      )
   }
);
SubmitForm(NewTicketForm);
ResetForm(NewTicketForm);
Navigate(HomeScreen, ScreenTransition.Cover)

 

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.

View solution in original post

@WarrenBelz 

The attachment is now sending with email. 

@thunter ,

Nothing has changed other than putting the attachments in the right place.

You have not referred to your SQL table name - the control values will work as they are "static". Are you sending this from inside or outside a form or gallery?

@WarrenBelz 

I figured it out. I edited my reply to remove the question about SQL. We are all good.

 

Thanks for your help!!

Helpful resources

Announcements
PA_User Group Leader_768x460.jpg

Manage your user group events

Check out the News & Announcements to learn more.

Power Query PA Forum 768x460.png

Check it out!

Did you know that you can visit the Power Query Forum in Power BI and now Power Apps

Carousel 2021 Release Wave 2 Plan 768x460.jpg

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

R2 (Green) 768 x 460px.png

Microsoft Dynamics 365 & Power Platform User Professionals

DynamicsCon is a FREE, 4 half-day virtual learning experience for 11,000+ Microsoft Business Application users and professionals.

Users online (2,084)