cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Post Prodigy
Post Prodigy

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

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

1 ACCEPTED SOLUTION

Accepted Solutions
Resident Rockstar
Resident Rockstar

Hi @DAVIDPOWELL ,

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."

View solution in original post

2 REPLIES 2
Resident Rockstar
Resident Rockstar

Hi @DAVIDPOWELL ,

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."

View solution in original post

Super User III
Super User III

@DAVIDPOWELL 

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.

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up. Solved your problem? - Click on Accept as Solution. Others seeking the same answers will be happy you did.
Check out my PowerApps Videos too!

Helpful resources

Announcements
News & Announcements

Community Blog

Stay up tp date on the latest blogs and activities in the community News & Announcements.

Power Apps Community Call

Power Apps Community Call- January

Check out the Power Apps Community Call for January 2021

PP Bootcamp Carousel

Global Power Platform Bootcamp

Dive into the Power Platform stack with hands-on sessions and labs, virtually delivered to you by experts and community leaders.

secondImage

Power Platform Community Conference On Demand

Watch Nick Doelman's session from the 2020 Power Platform Community Conference on demand!

Top Solution Authors
Top Kudoed Authors
Users online (11,549)