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 / changing the TO part o...
Power Apps
Answered

changing the TO part of the email based on a lookup function

(0) ShareShare
ReportReport
Posted on by Microsoft Employee

I have 2 dropdowns "Topics" and "SubTopic" on a screen(not a form)

 

I need this Lookup function find the email address. 

Lookup(sales_category, Topics=Topics_Input.Selected.Result && SubTopic = Subtopic_Input.Selected.Result,email)

then

i need the "email" part of this function for the  "TO" address in the email creation below ?

 

 

What I need:

I need to change the "TO" email address based on the Lookup above ? in the code below ?

 

 

Office365Outlook.SendEmailV2(
 "Sales_Incentive_Finc@xxxxxx.com",
 "Work Request: " & varLastID & "", 
 "Sales Intake: Question Submission" & " "
& "<br>Request Id: " & varLastID & "" 
& "<br>Requestor: " & Requestor_Input.Text & "" 
& "<br>Requestor_User_Id: " & Requestor_Input_Racfid.Text & "" 
& "<br>Impacted_Team_Member: " & txtTeam_Member_V.Text & "" 
& "<br>Impacted_Team_Member_Racfid: " & txtRacfid.Text & ""
& "<br>Topic: " & Topics_Input.Selected.Result & "" 
& "<br>Sub_Topic: " & Subtopic_Input.Selected.Result & "<br><br>"
& "<br>Question: " & txtQuestion_Submit.Text & "<br><br>"
& "<br>For Sales Operation Team: <a href='https://apps.powerapps.com/play/2xxxxxxxx792f14b-9c8b-43cdvfvfvf-b953-23xxxxx089573cccxx1498?tenantId=48d1dcb6-bccc-4365-ac7f-b937a7f7fd71&FormID=" & varLastID & "'> Link </a>"
,
 {
 Attachments: ForAll( // Modify formula here
 RenameColumns(Form_Create_Id.LastSubmit.Attachments, "DisplayName", "FileName", "Value", "FileContent"),
 {
 Name: FileName, 
 ContentBytes: FileContent, 
 '@odata.type': ""
 }
 )
 }
);

 

 Thanks

Dave

Categories:
  • Verified answer
    Vijay Tailor Profile Picture
    2,961 on at

    Hi @Anonymous ,

    You can Use Like below,

     

    Set(ToEMailVar,Lookup(sales_category, Topics=Topics_Input.Selected.Result && SubTopic = Subtopic_Input.Selected.Result,email))

     

     

    In To Place mention like below.

     

    Text(ToEMailVar.Email)

     

    This is Another way simply to use the existing Lookup Function like below.

    VijayTailor_0-1601398494922.png

     


    Thanks,

    Please click "Accept as Solution" if my post answered your question so that others may find it more quickly. If you found this post helpful consider giving it a "Thumbs Up."

  • RandyHayes Profile Picture
    76,299 Super User 2024 Season 1 on at

    @Anonymous 

    Have you tried to simply put that function into your sendmail function? 

    Consider the following change to your formula:

    Office365Outlook.SendEmailV2(
     LookUp(sales_category, 
     Topics=Topics_Input.Selected.Result && 
     SubTopic = Subtopic_Input.Selected.Result,
     email
     ),
     "Work Request: " & varLastID & "", 
     "Sales Intake: Question Submission" & " "
    ...etc...

     

    I hope this is helpful for 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 Apps

#1
11manish Profile Picture

11manish 345 Super User 2026 Season 2

#2
M Bilal Khan Profile Picture

M Bilal Khan 312

#3
Mohsin Ali Profile Picture

Mohsin Ali 252

Last 30 days Overall leaderboard