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 email via shar...
Power Apps
Answered

sending email via sharepoint list

(0) ShareShare
ReportReport
Posted on by 290

Hey! I have a sharepoint list

database123.png

 

NameOfEmployee is an employee's email address. If I work at Finance department, I want my manager to get an email everytime I have requested a day off. I have tried this:

 

Office365Outlook.SendEmail(LookUp(
 Employees,
 Department = varMyDept,
 Position = "Manager"
 ).NameOfEmployee ,"test", "test")

varMyDept is my department. It does not compile, can somebody help please?

Categories:
  • zmansuri Profile Picture
    6,048 Super User 2024 Season 1 on at

    If position and department is choice type field then you need to write

    Department.Value

    Position.Value

     

    Another thing you can do is set the manager's email address in a variable on OnStart and reference that variable in outlook code

  • Filistyn Profile Picture
    290 on at

    I can do that, but there are many departmens in our company, so I would have to set as many variables as there are managers, which I don't want to do since It's not effective.

  • zmansuri Profile Picture
    6,048 Super User 2024 Season 1 on at

    You only need one variable that will save logged in user's manager's email.

  • Filistyn Profile Picture
    290 on at

    Great idea, I have tried this 

    Set(
     varManager,
     LookUp(
     Employees,
     Department = varMyDept,
     Position = "Manager"
     ).NameOfEmployee
    )

    Doesn't work

  • PriyankaGeethik Profile Picture
    3,320 Super User 2024 Season 1 on at

    Hi @Filistyn ,

    Could you please try below formula. I assume you varDept will be having something like 'Finance' or 'CS & Logistic'.

     

    	Office365Outlook.SendEmail(LookUp(
     Employees,
     Department.Value = varMyDept,
     Position = "Manager"
     ).NameOfEmployee ,"test", "test")

     

    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.

  • Filistyn Profile Picture
    290 on at

    Doesn't work since department is Single line of text

  • Verified answer
    PriyankaGeethik Profile Picture
    3,320 Super User 2024 Season 1 on at

    @Filistyn 

     

    One more try with same formula 

    	Office365Outlook.SendEmail(LookUp(
     Employees,
     Department= varMyDept && 
     Position = "Manager"
     ).NameOfEmployee ,"test", "test")
  • zmansuri Profile Picture
    6,048 Super User 2024 Season 1 on at

    check what value you are getting in varManager using label. if you are getting correct email id. Try adding that variable name in double quotes in outlook code

  • Filistyn Profile Picture
    290 on at

    Works perfectly! Thank you very much sir!

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 220 Super User 2026 Season 2

#2
WarrenBelz Profile Picture

WarrenBelz 194 Most Valuable Professional

#3
Mohsin Ali Profile Picture

Mohsin Ali 150

Last 30 days Overall leaderboard