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

10 REPLIES 10
WarrenBelz
Super User
Super User

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.

@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
Power Platform Conf 2022 768x460.jpg

Join us for Microsoft Power Platform Conference

The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.

365 EduCon 768x460.png

Microsoft 365 EduCon

Join us for two optional days of workshops and a 3-day conference, you can choose from over 130 sessions in multiple tracks and 25 workshops.

Top Solution Authors
Users online (4,751)