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 Automate / Use an expression to s...
Power Automate
Suggested Answer

Use an expression to send an email to the right manager

(0) ShareShare
ReportReport
Posted on by 97
Hello,
 
I had to rebuild my old flow and i was using an expression to get the email of the user selected in my dropdown on my powerapp.  Below is the code i was using but however with the build i am not using "Apply to each 2", im not using any apply to each conditions so what would i need to do to update this?  i tried just removing the them but i still get an error.
 
toLower(concat(slice(items('Apply_to_each_2')?['Manager_x0020_Approval_x0020__x00'], 0, 1), split(items('Apply_to_each_2')?['Manager_x0020_Approval_x0020__x00'], ' ')[sub(length(split(items('Apply_to_each_2')?['Manager_x0020_Approval_x0020__x00'], ' ')), 1)], '@imrf.org'))
Categories:
  • Nived_Nambiar Profile Picture
    18,138 Super User 2026 Season 1 on at
     
    So to get better clarity could you show your flow ? also where you are input required for this expression stored - i.e the User details ?
     
     
    Thanks & Regards,
    Nived N 
    LinkedIn: Nived N's LinkedIn
    YouTube: Nived N's YouTube Channel
    Blog: Nived Nambiar's Blogs

     Found my answer helpful? Please consider marking it as the solution!
     Your appreciation keeps me motivated. Thank you! 

     
  • mfigliulo Profile Picture
    97 on at
    So i built out a power app where the Requestor field auto fills details so for Example if I am the requestor, a dropdown list called Authorized users will populate people from my department who can authorize.  (requestor = Matt Figliulo,  Authorize Official = Joe Smith)  or whoever i pick.  But the manager approval is Matt Figliulo where i need it to be mfigliulo@imrf.org (all lowercase).  So in power Automate i need to send an email based on the person who is selected in the authorized field but the text in that dropdown is Matt Figliulo not an actual email. I had it working with that code above but i dont have any apply each loops anymore. 
     
  • Suggested answer
    Nived_Nambiar Profile Picture
    18,138 Super User 2026 Season 1 on at
     
    Ok got it, but could you tell what is source from which you get the name of person from power apps in power automate flow- is it the trigger, because without getting the exact source, we can't create an expression.
     
    If the trigger is source from which we get the name of manager, use this expression- hope this can work
    toLower(concat(slice(triggerBody()?['Manager_x0020_Approval_x0020__x00'], 0, 1), split(triggerBody()?['Manager_x0020_Approval_x0020__x00'], ' ')[sub(length(split(triggerBody()?['Manager_x0020_Approval_x0020__x00'], ' ')), 1)], '@imrf.org'))
    
    
     
    Also the dropdown in power apps seems to be of person type object, if you want to retrive the email id of selected person in drop-down, u can get it by email attribute of selected person in power apps when submitting itself. check for some sources around that- i hope by implementing that way - it would be easier and you can avoid the usage of expression.
     
    Thanks & Regards,
    Nived N 
    LinkedIn: Nived N's LinkedIn
    YouTube: Nived N's YouTube Channel
    Blog: Nived Nambiar's Blogs

     Found my answer helpful? Please consider marking it as the solution!
     Your appreciation keeps me motivated. Thank you! 
  • mfigliulo Profile Picture
    97 on at
    I will try this out but in the meantime i did try a different route and started to use Offide 365 connector Search for users v2 which seems to work but i ran into an issue where it works and sends the email out but for one user the search for user output keeps coming back [] null.  Do you know why?
     
    this user worked : 
     
     
     
     
    This one wont: 
     
     
     
  • Nived_Nambiar Profile Picture
    18,138 Super User 2026 Season 1 on at
    Hi 
     
    If you look at placeholder of search for users action, you see search applies to certain properties of user, if that value/search term you are placing does not come under any property, it won't give any result.
     
    Thanks & Regards,
    Nived N 
    LinkedIn: Nived N's LinkedIn
    YouTube: Nived N's YouTube Channel
    Blog: Nived Nambiar's Blogs

     Found my answer helpful? Please consider marking it as the solution!
     Your appreciation keeps me motivated. Thank you! 

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 Automate

#1
Mohsin Ali Profile Picture

Mohsin Ali 426

#2
11manish Profile Picture

11manish 349 Super User 2026 Season 2

#3
M Bilal Khan Profile Picture

M Bilal Khan 308

Last 30 days Overall leaderboard