Could you do me a favor?
Aug 06, 2024
"Could you do me a favor?" a client of mine asked this week.
"Could you make it so an email is sent when the status field changes?"
They're using a custom object.
And when it hits a certain status, they want to notify the next person in line that they can start their part of the process.
Yes, definitely, I thought. That's easy, a Flow can do it.
And then came the plot twist: "can you also make the email include the most recently uploaded file on the record as an attachment?"
I know you can include attachments in an email template.
But pulling a file from a record and dynamically attaching it to an email with a flow?
I wasn't sure on that one.
I told my client I'd see what I could come up with.
That's when I thought of Claude.
I saw some guy raving about its performance online (it's a LLM like ChatGPT) and figured - why not give it a shot?
So I signed up, got logged in, and asked, "Can you write an Apex component that will allow me to send an attachment in an email via Salesforce Flow?"
In about three seconds it generated an Apex class.
To be honest, I was expecting it to fail (or be impossibly difficult to work with) like much of the ChatGPT code I've worked with.
So, with low expectations, I pasted it into the developer console, and then headed to the Flow Builder to see if the Apex action was available.
Sure enough, it was there.
And after configuring the parameters:
I was able to send an email - and the attachment of the most recent file came through perfectly.
Impressive.
I had Claude create some test classes to get the code to >90% coverage.
And in less than 15 minutes, we were up and running with production-ready code.
What a world.
- Here is a link to the Apex Code and Test class for the Flow Email Attachment action
- And I also used Claude to rewrite the Convert Lead in a Flow Apex code I shared with you last week. Here is a link to the updated Apex code
And that's my story this week.
To be honest, I felt a little spooked by this experience. It left me with questions:
- Do we even need developers anymore?
- If LLM's keep improving at such a fast clip, where will be in five years? Will we have jobs?
- What are other Salesforce professionals using LLM's for that I have no idea about?
I don't know the answers...
But if you have any thoughts or ideas on these, reply to this email now and tell me :)
And I hope you get some use out of that email action.
Have a great weekend!
Best,
Nick
Salesforce Saturdays
Join the Salesforce Saturday newsletter. Every Saturday, you'll get 1 actionable tip on Salesforce technology or career growth related to the Salesforce Industry.
We hate SPAM. We will never sell your information, for any reason.