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

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Sending a mail based o...
Power Apps
Answered

Sending a mail based on choicebox

(0) ShareShare
ReportReport
Posted on by Microsoft Employee

Hello!

I have a multiple choice box and whenever the selected value equals "Vrijgegeven", I want to send a mail. 

This is the code I've tried so far, it sends the mail without the if statement:

If(
 DataCardValue29.SelectedText.Value = "Vrijgegeven";
 Office365Outlook.SendEmail(
 "The email";
 "Nieuwe vrijgegeven manco";
 "Nieuwe vrijgegeven manco met bestandsnaam: " & DataCardValue12.Text
 )

 

Categories:
  • mdevaney Profile Picture
    29,993 Moderator on at

    @Anonymous 
    Can you please write this code and let me know if there are any options available other than Value?  Your word Vrijgegeven might be stored under a different column name.

    DataCardValue29.Selected.

     

    Also, SelectedText is deprecated.  You dont want to use this because it is being deleted from the PowerApps language.  Instead you can simply use Selected.

     

    ---
    Please click "Accept as Solution" if my post answered your question so that others may find it more quickly. If you found this post helpful consider giving it a "Thumbs Up."

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    It does say "Vrijgegeven". I just made a label with DatacardValue29.Selected.Value and it says that. So do you think if I use DatacardValue29.Selected it will work?

    https://gyazo.com/8599ee3d818c9981d691c006f2d4b586

    @mdevaney 

  • mdevaney Profile Picture
    29,993 Moderator on at

    @Anonymous 

    No, that's not what I meant.  Type this... then see what other columns Autocomplete suggests.  My theory is you have the wrong column name.

     

    DataCardValue29.Selected.

     

    ---
    Please click "Accept as Solution" if my post answered your question so that others may find it more quickly. If you found this post helpful consider giving it a "Thumbs Up." 

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    It only gives me the option "Value" @mdevaney 

  • mdevaney Profile Picture
    29,993 Moderator on at

    @Anonymous 
    OK, as a test, please put this code in the Text property of a label and let me know whether it says true or false.

    DataCardValue29.Selected.Value = "Vrijgegeven"

     

    ---
    Please click "Accept as Solution" if my post answered your question so that others may find it more quickly. If you found this post helpful consider giving it a "Thumbs Up."

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    It indeed turns to true whenever I change the status to "Vrijgegeven" @mdevaney 

  • mdevaney Profile Picture
    29,993 Moderator on at

    @Anonymous 

    Perfect, then the problem is not the IF statement condition.  The problem is your email code.

     

    ---
    Please click "Accept as Solution" if my post answered your question so that others may find it more quickly. If you found this post helpful consider giving it a "Thumbs Up." 

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    Weird... Whenever I use the code without the if statement it works... Here is the code: 

     

    Office365Outlook.SendEmail("theemail";"Message";"Message)

     

    I have this code on the OnSuccess off my form, maybe that is the problem?

    @mdevaney  

  • Verified answer
    mdevaney Profile Picture
    29,993 Moderator on at

    @Anonymous 

    Yes, that is 100% the problem.  When the form submits it is likely clearing out your dropdown.

     

    Use this idea instead...

    If(
     Form1.LastSubmit.your_column_name = "Vrijgegeven";
     Office365Outlook.SendEmail(
     "The email";
     "Nieuwe vrijgegeven manco";
     "Nieuwe vrijgegeven manco met bestandsnaam: " & DataCardValue12.Text
    )

     

     

    ---
    Please click "Accept as Solution" if my post answered your question so that others may find it more quickly. If you found this post helpful consider giving it a "Thumbs Up."

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    Thank you so much 🙂 

    @mdevaney 

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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 381 Super User 2026 Season 2

#2
Mohsin Ali Profile Picture

Mohsin Ali 340

#3
WarrenBelz Profile Picture

WarrenBelz 187 Most Valuable Professional

Last 30 days Overall leaderboard