web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Error 400 message when...
Power Apps
Answered

Error 400 message when i trigger an email through Power Apps

(1) ShareShare
ReportReport
Posted on by 57
Hi all
 
I am working on an app to email volunteers by collecting their details via a collection (sharepoint list) or by typing in their details into a TO box (textsearchbox2_1)
 
The code I am using is 
 
If(
    IsBlank(TextSearchBox2_1),
    ForAll(
        Colemaillist,
        Office365Outlook.SharedMailboxSendEmailV2(
            "info@uk.com",
            Your_x0020_email_x0020_address,
            TextEmailSubject2_1.Text,
            "Dear " & Your_x0020_first_x0020_name & "<br><br>" & RTEBody.HtmlText,
            {
                Attachments: RenameColumns(
                    AttachmentControl.Attachments,
                    Value,
                    ContentBytes
                ),
                Importance: "Normal"
            }
        )
    ),
    Office365Outlook.SharedMailboxSendEmailV2(
        "info@uk.com",
        Concat(
            MyPeople,
            Mail,
            ";"
        ),
        TextEmailSubject2_1.Text,
        RTEBody.HtmlText,
        {
            Attachments: RenameColumns(
                AttachmentControl.Attachments,
                Value,
                ContentBytes
            ),
            Importance: "Normal"
        }
    )
);
Reset(TextEmailSubject2_1);
Reset(RTEBody);
Reset(AttachmentControl);
Clear(Colemaillist);
Clear(MyPeople)
 
The first part of the code works great by itself, however, the second Office365Outlook string - email fails as there is no text in ,Concat(mypeople,Mail,";") TextSearchbox2_1
 
Any ideas?
Categories:
I have the same question (0)
  • WarrenBelz Profile Picture
    153,059 Most Valuable Professional on at
    You seem to have too many parameters - syntax is To,Subject,Body,{parameters} - you have 2 To items in the first and 3 in the second. Also what is MyPeople and how is it formatted ?
  • mickgibbons4530 Profile Picture
    57 on at
    Hi warren
     
    So the first part 
    If(
        IsBlank(TextSearchBox2_1),
        ForAll(
            Colemaillist,
            Office365Outlook.SharedMailboxSendEmailV2(
                "info@uk.com",
                Your_x0020_email_x0020_address,
                TextEmailSubject2_1.Text,
                "Dear " & Your_x0020_first_x0020_name & "<br><br>" & RTEBody.HtmlText,
                {
                    Attachments: RenameColumns(
                        AttachmentControl.Attachments,
                        Value,
                        ContentBytes
                    ),
                    Importance: "Normal"
                }
     
    This works fine on its own, basically, if Text search box2_1 (The Sent to email address) is blank,
    then send to emails collected in Collection

    I then added in the second part for when the searchbox has an email address in. Send to email

    address in the searchbox.The mypeople links to users on the system, finds them if i place in a
    work colleague (to be fair, its not needed). Both work by themselves,but together,
    the second part gets an error if there is not email address in the search box  
  • Verified answer
    WarrenBelz Profile Picture
    153,059 Most Valuable Professional on at
    OK - I did not read it properly - it is a shared mailbox - you probably need as the top trigger
    If(
        Len(TextSearchBox2_1.Text) = 0,
     
    Please click Does this answer your question 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 a Like.
    MVP (Business Applications)     Visit my blog Practical Power Apps    Buy me a coffee
  • mickgibbons4530 Profile Picture
    57 on at
    Warren,
     
    I cannot tag in my posts but finally I can set replies to Answer. 

    Thank you so much for taking the time to reply to my issue, yet again i have learned a lot and you have smashed it. Keep up the good work and ill get a coffee to you soon.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 711 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 319 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard