I need to create an email alert everytime an opportunity closes won and attach the latest file to it. I found that I was able to use the Get Record with Send Better Email. But the issue I'm having is that its collecting all of the File records and attaching it to the email, I only need the latest one. In the Get record I'm using Content Document Link as the object as this is the one that send better email needs in order to attach the file, but it need to collect all records. Any idea how to create the flow in which it attaches only the latest record(file)?
Steven Trumble (Strum Consulting) Forum Ambassador
whoops, I should've said sort element. This take a collection adn returns a collection. As I said before, sort by created date desc to get the latest one, only keep one record and you should be fine.
https://help.salesforce.com/s/articleView?id=sf.flow_ref_elements_sort.htm&type=5