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 / How to send email from...
Power Apps
Answered

How to send email from combo box with data sources from Office365Users with a button

(0) ShareShare
ReportReport
Posted on by 25

Hi There,

I am building a notification Power App for our front counter for when a delivery arrives, the driver can type the name of the person from the combo box which I have connected to our Office365users and then I have a button to send the email to the user.  I have tested the combo box and the email address does appear of the person I type in.

I have tried both of these in the onselect details:

1. Office365Outlook.SendEmailV2(Concat(ComboBox1_2.SelectedItems,Email&";"),"Subject-Delivery Notification"," Message-A Delivery has arrived for you at Reception",
(From:{"frontcounter email address")

 

2. Office365Outlook.SendEmailV2(ComboBox1_2.SelectedItems,Email&";"),"Subject-Delivery Notification"," Message-A Delivery has arrived for you at Reception",
(From:{"frontcounter email address")

 

The details of the error in formula states that "Unexpected characters are used in the formula in an unexpected way. Remove or replace the Unexpected characters"  And Invalid number of arguments.

 

Any suggestions would be much appreciated.

Thanks

Categories:
I have the same question (0)
  • WarrenBelz Profile Picture
    153,084 Most Valuable Professional on at

    Hi @jamesraffmr ,

    Try this

    Office365Outlook.SendEmailV2(
     Concat(
     ComboBox1_2.SelectedItems,
     Email & ";"
     ),
     "Subject-Delivery Notification",
     " Message-A Delivery has arrived for you at Reception",
     {From: "frontcounter email address"}
    )

     

    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.

    Visit my blog Practical Power Apps

  • jamesraffmr Profile Picture
    25 on at

    Hi WarrenBelz,

    Your suggestion has returned no errors on the formula which is great, Thank you.   But it has now shown a runtime error.  I have attached the screen shot of the details.  I have also attached the screen that I am working with and  shows the combo box to enter the emails with formula in onselect: Office365Users.SearchUser({searchTerm:ComboBox1_2.SearchText})   This seems to work as when tested it shows the names of the people when you start typing.   

     

    The Button that I have on that screen also is with the formula you have provided:

    Office365Outlook.SendEmailV2(
    Concat(
    ComboBox1_2.SelectedItems,
    Email & ";"
    ),
    "Subject-Delivery Notification",
    " Message-A Delivery has arrived for you at Reception",
    {From: "frontcounter email address"}
    )Any suggestions on this?


    Thank you again

  • WarrenBelz Profile Picture
    153,084 Most Valuable Professional on at

    Hi @jamesraffmr ,

    Firstly get rid of the {From: . . .} and see if that is the issue

  • jamesraffmr Profile Picture
    25 on at

    Hello WarrenBelz,

    I have removed the {From: . . .} and have the formula as below now, but the runtime error is still showing as per attached.

    Office365Outlook.SendEmailV2(
    Concat(
    ComboBox1_2.SelectedItems,
    Email & ";"
    ),
    "Subject-Delivery Notification",
    " Message-A Delivery has arrived for you at Reception")

     

     

  • WarrenBelz Profile Picture
    153,084 Most Valuable Professional on at

    @jamesraffmr ,

    It is saying at least the one of the email recipients is invalid. Put this on a Label

    Concat(
     ComboBox1_2.SelectedItems, 
     Email & ";"
    )

    and see if it produces what you expect.

     

    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.

    Visit my blog Practical Power Apps

     

  • jamesraffmr Profile Picture
    25 on at

    Hello WarrenBelz,

    I have entered the following on the label and no runtime error 

    Concat(
    ComboBox1_2.SelectedItems,
    Email & ";"
    )

  • jamesraffmr Profile Picture
    25 on at

    Hello WarrenBelz,

     

    I have tried to also add the following after your formula to see if an email comes through but no luck on that.

    Concat(
    ComboBox1_2.SelectedItems,
    Email & ";"
     "Subject-Delivery Notification",
    " Message-A Delivery has arrived for you at Reception",
    {From: "frontcounter"

  • WarrenBelz Profile Picture
    153,084 Most Valuable Professional on at

    @jamesraffmr ,

    Yes - but what was the content of the label? It should be some valid email addresses separated by ; - the error was you had invalid email addresses

  • jamesraffmr Profile Picture
    25 on at

    Hello WarrenBelz,

    We are definitely getting close. 🙂  When I added the following in the label, the email came through as I just added my own email address.

    Office365Outlook.SendEmailV2(
    Concat(
    ComboBox1_2.SelectedItems,
    Email;"myownemailaddressaddedhere";
    ),
    "Subject-Delivery Notification",
    " Message-A Delivery has arrived for you at Reception",
    {From: "frontcounteremailaddressaddedhere"}
    )

     

    Is there a way to have the selected email address that I searched for from the combobox to be the email that is sent to that selected person.  

     

    Thank you again 

     

  • WarrenBelz Profile Picture
    153,084 Most Valuable Professional on at

    Hi @jamesraffmr ,

    You still have not told me what was on the label.

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 739 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 343 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard