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 / Toggling Email Distrib...
Power Apps
Answered

Toggling Email Distribution Lists

(0) ShareShare
ReportReport
Posted on by 11

Hello. I am trying to make it so my app has the ability to toggle two different email distribution lists depending on the data collected in the app. I have made others with an email distribution, and have not had any issues there. It is when I try to say that if the toggle is true or false to send it to different email groups that it isn't happy. Any help would be appreciated. 

Categories:
I have the same question (0)
  • eka24 Profile Picture
    20,925 on at

    What formula are you using

    ------------

    If you like this post, give a Thumbs up. Where it solved your request, Mark it as a Solution to enable other users find it.

  • tomemart Profile Picture
    11 on at

    Thanks for your reply. Below is what I had. I substituted out the actual names and email subject/body.

    Office365Outlook.SendEmail(
    (If

    ((Toggle1="true_value")
    "Distribution List A")
    ((Toggle1= "false_value")
    "Distribution List B")),
    "Subject ",
    Body,

    );

  • Verified answer
    eka24 Profile Picture
    20,925 on at

    If(Toggle1.Value=true,

    Office365Outlook.SendEmail(

    "Distribution List A",
    "Subject ",
    Body),

    Office365Outlook.SendEmail(

    "Distribution List B",
    "Subject ",
    Body))

    ------------

    If you like this post, give a Thumbs up. Where it solved your request, Mark it as a Solution to enable other users find it.

  • Verified answer
    v-bofeng-msft Profile Picture
    Microsoft Employee on at

    Hi @tomemart :

    Firstly, let me explain why the code doesn't work.

    The point is ways to quote the value of "Toggle control".As mentioned by @eka24 ,the correct way is 

     

    Toggle1.Value

     

    Because it is a boolean type value, it can be used directly without having to judge whether it is true.

    Secondly, I suggest you try this code.

     

    Office365Outlook.SendEmailV2(
     If(
     Toggle1.Value,
     "email address 1",
     "email address 2"
     ),
     "Subject",
     "Body"
    )

     

    Best Regards,

    Bof

  • tomemart Profile Picture
    11 on at

    Got it to work! Thank you both for your help.

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

Congratulations to the July Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 358 Most Valuable Professional

#2
11manish Profile Picture

11manish 214 Super User 2026 Season 2

#3
Mohsin Ali Profile Picture

Mohsin Ali 185

Last 30 days Overall leaderboard