I'm building a PowerApps canvas app with SQL Server Azure database as the data source. I have a USERS table with two columns, EMail being the PK.
USERS(EMail, RoleId)
The RoleId references another table but it's not important for the purpose of this question. When a new user is added to the table, I'd like Power Automate to send an EMail to the person using Outlook connector. Usually, once the 'record added' is triggered, the way I get the 'latest' record is by sorting the ID desc, and getting the top 1 record. Below is an example of how I do it, in another table.
Above works because every time I add a record the RFQ_ID is increased, so the largest RFQ_ID is always the latest record. But obviously this won't work with an email. Is there a way to get the newest record that isn't based on sorting data?
Note:
ITEM CREATED Tickets is a 'When an item is created (V2)' SQL trigger.
GET NEW RECORD Tickets is a 'Get rows (V2)' SQL trigger.
Hi @Anonymous
Could you please explain more why it doesn't work with mail? What's the process?
Thanks
If you liked my response, please consider giving it a thumbs up
Proud to be a Flownaut!
Learn more from my blog@abm because sorting email won't necessarily give you the most recently added record.
Hi @Anonymous
Add a new column called 'SendEmail' boolean field, default as false. Filter the record by false and send the email. Once email is sent then update the flag to true. Is that works for you?
Thanks
If you liked my response, please consider giving it a thumbs up
Proud to be a Flownaut!
Learn more from my blogWell, that technically can work, but that's a rather a large detour for something that should be simple. Also, the user table is but one example of many tables I need to do something after adding a record so doing this for each table is very redundant and error prone. I was wondering if there's a feature in SQL connector or some other way that would easily identify us the newly added record.