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 / Depending on a selecti...
Power Apps
Unanswered

Depending on a selection send an Email template to specific recipitant

(0) ShareShare
ReportReport
Posted on by 1,154

Hi,

I would like to send an email which will be slightly different depending on a selection made.  

So if employee selected the email will display in the body different information to that if manager is selected.
The manager email address is displayed with the formula using HTML text. 

ClarkyPA365_0-1647266591897.png


Currently this information does not appear in a Datasource (SharePoint) so was wondering if this can be actioned directly from the link in the Powerapp??

Categories:
I have the same question (0)
  • sgtsnacks64 Profile Picture
    322 Super User 2024 Season 1 on at

    Hi Clarky,

     

    Can you share a little more on what you're trying to achieve with this?

     

    > Is the selection based on the type of employee, or is something like a toggle option between Employee and Manager

    > What changes are made to the template between Manager and Employee?

     

    I'd be looking to set a variable with each template based on the type of employee, like:

     

    Set(gblEmlTemplate, If(Type.Employee,"<a>Employee Template</a>","<a>Manager Template</a>"))

  • Nogueira1306 Profile Picture
    7,390 Super User 2024 Season 1 on at

    You can do a condition in the "default" of the power app:

     

    If(User().Email = ManagerEmail,

    TEXT FOR THE MANAGER HERE,

    TEXT FOR USER HERE

    )

     

    If you need additional help please tag me in your reply and please like my reply.
    If my reply provided you with a solution, pleased mark it as a solution ✔️!

    Best regards,

    Gonçalo Nogueira

    Check my LinkedIn!

    Buy me a coffee!

    Check my User Group (pt-PT)!

    Last Post on Community

    My website!

  • Chris1968 Profile Picture
    1,154 on at

    Hi,

    It's based on an absence app and if the employee as Covid or not.

    If Covid is selected,  via a toggle, then the body of the email template will contain different information than if not Covid.
    The email will go to the same Line manager.

    Regards

     

    Chris

  • sgtsnacks64 Profile Picture
    322 Super User 2024 Season 1 on at

    Awesome,

     

    @Nogueira1306 's solution stands,

     

    HtmlText.Default = If(tglCovid.Value,

    TEXT FOR THE COVID HERE,

    TEXT FOR NO COVID HERE

    )

  • Chris1968 Profile Picture
    1,154 on at

    Hi
    Would this allow me to add information that has been collected such as name of employee, Expected return date,.

    When you say 'default' where would this be??  Sorry 

  • Nogueira1306 Profile Picture
    7,390 Super User 2024 Season 1 on at

    Nogueira1306_0-1647269001021.png

     

    You can insert that condition here

    You can keep your code, the only diference is that it can change based on your toogle/Checkbox.

    You can define text for Covid and Not Covid and you can insert info from textboxs, comboboxs, etc

     

    If you need additional help please tag me in your reply and please like my reply.
    If my reply provided you with a solution, pleased mark it as a solution ✔️!

    Best regards,

    Gonçalo Nogueira

    Check my LinkedIn!

    Buy me a coffee!

    Check my User Group (pt-PT)!

    Last Post on Community

    My website!

  • Chris1968 Profile Picture
    1,154 on at

    Hi,

    This is the formula I have currently

    ClarkyPA365_0-1647269401340.png

    The new bit will be added after the last & and before "</a>"?
    If I want to more information to the body of the email I'll just add the a Name and then reference the respective field.
    For example - 
     Text for Covid

    Employees Name : Text(EmpName.Text),
    Covid Reason: (DatacardValue.Selected.Value),
    Return Date :  (DatacardValue.Selected. Value),

    Text for no Covid

    Employee Name: Text(EmpName.Text),
    Absence Reason: (DatacardValue.Selected.Value),

    Sorry but how will it look??

  • Nogueira1306 Profile Picture
    7,390 Super User 2024 Season 1 on at

    If( tglCovid.Value,

     

    If( tglCovid.Value,
    "<a href = "mailto:" && Office365Users.ManagerV2(DataCardValue7_6).mail && "?subject = Absence & body =
    Employees Name : " && Text(EmpName.Text) && ",
    Covid Reason: " && (DatacardValue.Selected.Value) && ",
    Return Date : " && (DatacardValue.Selected. Value) && ">",

    "<a href = "mailto:" && Office365Users.ManagerV2(DataCardValue7_6).mail && "?subject = Absence & body =
    Employees Name : " && Text(EmpName.Text) && ",
    Absence Reason : " && (DatacardValue.Selected. Value) && ">"

    )

     

    Something like that

  • Chris1968 Profile Picture
    1,154 on at

    Hi,

    If tried to add a formula in which I hoped would work but there is an error

    ClarkyPA365_0-1647272503854.png

    Return Date: DataCardValue54.SelectedDate Error Invalid argument typr. Expecting one of the following: Boolean, Text, number, option set value. 


  • Nogueira1306 Profile Picture
    7,390 Super User 2024 Season 1 on at

    Check the datacard value... you were the one tolding me that....

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!

Leaderboard > Power Apps

#1
Haque Profile Picture

Haque 94

#2
WarrenBelz Profile Picture

WarrenBelz 82 Most Valuable Professional

#3
Kalathiya Profile Picture

Kalathiya 38 Super User 2026 Season 1

Last 30 days Overall leaderboard