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 / Help with formula - se...
Power Apps
Answered

Help with formula - send email if toggle is yes

(0) ShareShare
ReportReport
Posted on by 1,625

Hi

I need some help with the following.

 

I have on a screen a yes/no field (Toggle), if yes is selected I want to email a specific user (I will be hardcoding the users email, as I have reached the limit I can use for a person type field on this form). 
Issue I have is firstly how I do this (maybe on the OnChange property but what if the user than changes back to the default of 'No' i'd like nothing to happen), but secondly as I have only 1 submit button, which sends out a standard email to notify the form has been completed, ideally I don't want to send any text in the email related to requiring approval if the toggle is 'No', as its pointless to have text in the email "this requires approval", when it doesn't. Issue is I cant have 2 screens, as the questions fit on 1 screen?

 

Any ideas?

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

    Try this formula on OnSelect of the button:
    If(Toggle1.Value,............)

  • Lefty Profile Picture
    1,625 on at

    HI @eka24 

    Thanks, needed a nudge in the right direction, but i dont seem to get an email come through, this is what I have done on the submit buttons OnSelect:

     

    SubmitForm(Form1);
    Office365Outlook.SendEmailV2(Form1.LastSubmit.ApplicantName.Email, CurrentUser.FullName & " - has updated Part T " , "please review <a href='https://apps.powerapps.com/play/MYURL&St=" & Form1.LastSubmit.ID & "'> Link to submitted form </a> ",{Cc:CurrentUser.Email});
    If(DataCardValue70.Value, true, Office365Outlook.SendEmailV2("HardCodedEmail", " This request has been marked as requiring approval. Review the form, "Please review the form and complete as appropriate & Char(10) & <a href='https://apps.powerapps.com/play/MYURL&St=" & Form1.LastSubmit.ID & "'> Link to submitted form </a> ",{Cc:DataCardValue81.Selected.Email}))

    I get an email, related to the first bit, but nothing for when i set the toggle to true?

  • eka24 Profile Picture
    20,923 on at

    Please what is the name of your toggle. If its DataCardValue70, then remove the true:

     

    If(DataCardValue70.Value,Office365Outlook.SendEmailV2("HardCodedEmail", " This request has been marked as requiring approval. Review the form, "Please review the form and complete as appropriate & Char(10) & <a href='https://apps.powerapps.com/play/MYURL&St=" & Form1.LastSubmit.ID & "'> Link to submitted form </a> ",{Cc:DataCardValue81.Selected.Email}))

     

  • Lefty Profile Picture
    1,625 on at

    Hey @eka24 

    I'll give it a try, and yes my toggle is DataCardValue70

    If i do what you suggest, will it not send an email even if the toggle is set to no (false)?

    As i only want the email to be sent to the user if the toggle is set to yes (true)

  • Verified answer
    eka24 Profile Picture
    20,923 on at

    What error are you getting. Try DataCardValue70.Value=true instead of DataCardValue70.Value,true

    Please give error that comes up if it does not work

     

    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.

     

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Congratulations to the March Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 536

#2
WarrenBelz Profile Picture

WarrenBelz 426 Most Valuable Professional

#3
Haque Profile Picture

Haque 305

Last 30 days Overall leaderboard