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 / Adding a Report from a...
Power Apps
Answered

Adding a Report from another List to an Email

(0) ShareShare
ReportReport
Posted on by 62

Hello! Thanks to @mdevaney , I have a form that sends an email to the user when new information is added. This works beautifully, but I am wondering if it would be possible to also add a Report from another List where Lot # = Lot # and then pull the information from that list into the same email. Thank you for your time!!

 

Back(); Set(newRecord, EditForm1.LastSubmit);
Office365Outlook.SendEmail(
	User().Email,
	"Update for Lot# " & newRecord.'Lot #' & " MBR#" & newRecord.'MBR Number',
	
	"<b>Lot #: </b>"& newRecord.'Lot #'& "<p>" &
	"<b>MBR #: </b>"& newRecord.'MBR Number' & "<p>"&
If(!IsBlank(newRecord.'SKU3 Filled'), "<b>SKU3 Filled: </b>"& newRecord.'SKU3 Filled' & "Units" & "<p>")
, 
 
 {IsHtml: true, Importance: "Normal"}

);

 

Categories:
I have the same question (0)
  • mdevaney Profile Picture
    29,991 Moderator on at

    @crjwarre 
    Yes, you could use a LOOKUP function to retrieve another record from a different list having a matching Lot#.  Place the code directly after where you create newRecord as a variable.

     

    Set(otherListRecord, LookUp(your_target_listname, 'Lot #', newRecord.'Lot #'));

     

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

  • crjwarre Profile Picture
    62 on at

    Thank you! I will try this when I'm at work next!

  • KrishnaV Profile Picture
    5,023 on at

    Along with the solution from @mdevaney , I have noticed you are using User().Email this will pulldown the App performance. To avoid that at App onStart property create a global variable as Set(varUser,Office365Users.MyProfileV2()); (include Office365Users to work this). Now in your code say varuser.mail.

    which is eventually be as follows:

    Office365Outlook.SendEmail(
    	varUser.mail,
    	"Update for Lot# " & newRecord.'Lot #' & " MBR#" & newRecord.'MBR Number',
    	
    	"<b>Lot #: </b>"& newRecord.'Lot #'& "<p>" &
    	"<b>MBR #: </b>"& newRecord.'MBR Number' & "<p>"&
    If(!IsBlank(newRecord.'SKU3 Filled'), "<b>SKU3 Filled: </b>"& newRecord.'SKU3 Filled' & "Units" & "<p>")
    , 
     
     {IsHtml: true, Importance: "Normal"}
    
    );

     

    Regards,

    Krishna
    If this post helps give a 👍 and if it solved your issue consider  Accept it as the solution to help the other members find it more.

  • mdevaney Profile Picture
    29,991 Moderator on at

    @KrishnaV 

    I do that too, but for a totally different reason.  User().Email is not delegation-friendly when using a FILTER function but Set(varUser, User().Email) is.  So weird...

     

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

  • KrishnaV Profile Picture
    5,023 on at

    Sir,

     

    It is the best practice I have read in many of the MVP blogs, as you said user().email is not a delegable in filter this the recommended approach for better performance. Please correct me if you that as a wrong approach. I made it as a practice as I see immense change in performance (on a large Apps).

     

    Regards,

    Krishna
    If this post helps give a 👍 and if it solved your issue consider  Accept it as the solution to help the other members find it more.

  • crjwarre Profile Picture
    62 on at

    Ok, so in my case I would list Set(In-Process Issues, LookUp(In-Process Issues, 'Lot #', newRecord.'Lot #')); or would the otherListRecord be the field from the list I want to display? 

     

    @mdevaney  

  • crjwarre Profile Picture
    62 on at

    Hello, when I attempt this code, it throws Incompatible Type in the OnStart field for the app

     

    @KrishnaV 

  • mdevaney Profile Picture
    29,991 Moderator on at

    @crjwarre
    Suggest you use the @ symbol to tell us who you responding to.  There are multiple responders on the thread 🙂

  • mdevaney Profile Picture
    29,991 Moderator on at

    @crjwarre 
    I believe there was an error in my previous code 😮  I did not have any comparison in my LOOKUP 😉

     

    LookUp(In-Process Issues, 'Lot #' = newRecord.'Lot #');

     

    Note: In-Process Issues is assumed to be your "other" list in my example

     

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

     

  • crjwarre Profile Picture
    62 on at

     

    Hi, I think I'm having some conceptual issues with the formula, and I wanted to make sure my understanding was correct:

    Formula: Set(In-Process Issues, LookUp(In-Process Issues, 'Lot #' = newrecord.'Lot #'))

    So the Set() function is identifying the list to get the information from, and then the LookUp specifies the List again, and then is supposed to match where the entries are equal across the lists) I am getting an error in my code thus far.

    My other question is where would a function such as this pull the information from a column in the List In-Process issues called Event Description. 

     

    To put it in terms I am more familiar with, I want to perform (if it were a SQL Table) a Union WHERE Lot Number is the newRecord and pull any entries in Event Description column

     

    @mdevaney 

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

Congratulations to the July Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 356 Most Valuable Professional

#2
11manish Profile Picture

11manish 225 Super User 2026 Season 2

#3
Mohsin Ali Profile Picture

Mohsin Ali 211

Last 30 days Overall leaderboard