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"}
);
Solved! Go to Solution.
@crjwarre
Actually, SET is storing the record from the list 'In-Process Issues' in a variable. We should change the variable name to something else like this.
Set(varOtherRecord, LookUp(In-Process Issues, '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
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."
Thank you! I will try this when I'm at work next!
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.
Proud to be a Super User!
Regards,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."
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.
Proud to be a Super User!
Regards,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?
Hello, when I attempt this code, it throws Incompatible Type in the OnStart field for the app
@crjwarre
Suggest you use the @ symbol to tell us who you responding to. There are multiple responders on the thread 🙂
@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."
Stay up tp date on the latest blogs and activities in the community News & Announcements.
Dive into the Power Platform stack with hands-on sessions and labs, virtually delivered to you by experts and community leaders.
User | Count |
---|---|
214 | |
205 | |
86 | |
59 | |
38 |