Hello,
I have setup a flow to log (among other things) each email to a log table in on-premises database. This ran for some time and for the most part worked. I am developing this further with the understanding that the MessageId is a unique value, but I am finding that is is NOT unique.
If I execute :
SELECT * FROM audit.EventLog WHERE SourceId IN (
SELECT
[SourceId]
FROM [audit].[EventLog]
GROUP BY SourceId
HAVING COUNT(*)>1
)
AND sourceid='AAMkAGI4ZGQxODM3LTE1MTktNDlhOS05OTY1LThjNjBhZTExNjIwYwBGAAAAAAAbkuZPGNHBTY-o7TpPuklBBwBhG_qNiCDrR6haRvwuqbf4AAAAAAEMAABhG_qNiCDrR6haRvwuqbf4AAH8bhXXAAA='
ORDER BY SourceId,EventDateTime
I get two records (there are many instances of dups)

In this case, several hours apart and there is no connection between the two messages.
Is there a function available in flow for me to unique-fy the message?
The root problem I am trying to solve is - some emails we receive are the same name every time. Its not datestamped etc. So I need to have a name that is unique and of course the original name to know how to handle the file (pdf rip or parse csv, excel etc)