cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Anonymous
Not applicable

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 @Anonymous ,

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 @Anonymous ,

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.

Anonymous
Not applicable

@WarrenBelz 

AttachmentControl is the name of my control. 

attachmentcontrol2.png

@Anonymous ,

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.

 

Anonymous
Not applicable

@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

Anonymous
Not applicable

@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 @Anonymous ,

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.

Anonymous
Not applicable

@WarrenBelz 

The attachment is now sending with email. 

@Anonymous ,

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?

Anonymous
Not applicable

@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 Apps Africa Challenge 2022

Power Apps Africa Challenge

Your chance to join an engaging competition of Power Platform enthusiasts.

Super User 2 - 2022 Congratulations

Welcome Super Users

The Super User program for 2022 - Season 2 has kicked off!

September Events 2022

Check out all of these events

Attend in person or online, there are incredible conferences and events happening all throughout the month of September.

Government Carousel

New forum: GCC, GCCH, DoD - Federal App Makers (FAM)

In response to the unique and evolving requirements of the United States public sector, Microsoft has created Power Apps US Government.

Users online (1,808)