Send Email Attachments With Salesforce Flow

Поділитися
Вставка
  • Опубліковано 14 січ 2025

КОМЕНТАРІ • 80

  • @JeremyBrowne-b9i
    @JeremyBrowne-b9i 11 місяців тому +1

    This is killer. Do you know if there is a way to send only specific attachments related to a record? If I have an opportunity and I attach two documents to it, but then I need to attach two more documents to it and I want only the two most-recently attached documents to be attached to an email, how would I isolate those two attachments in the Flow?

    • @Rotive
      @Rotive  11 місяців тому

      Hey! Thanks for the comment. You could get the most recent document by using the Sort option in the Get by created date. Keep in mind this is looking at the record that links the file to your primary record, so it will return the most recently linked document which might not be the most recently created document.
      Another approach is to get all files related to your record and then loop through them. This lets you look at each file individually. Because ContentDocumentLink looks up to the file, we can also evaluate fields on the file like its created date and name. In the loop include a Decision with your criteria. If it meets the criteria, go down a path with an assignment step to set a variable to that file's ID and use that variable later in your flow when you send the email.
      Does that help?

    • @JeremyBrowne-b9i
      @JeremyBrowne-b9i 11 місяців тому

      @Rotive Hey thanks very much for the reply! My problem is a bit more complicated now because the files that I'm looking to place in an email are going to be attached to Chatter posts within Opportunity records. The only Chatter object available in a record-triggered flow is Chatter Activity and there doesn't appear to be any way to work with attachments from there.

    • @Rotive
      @Rotive  11 місяців тому

      @@JeremyBrowne-b9i That's tough. I might have to do some experimenting on this. What's the business case? What kinds of files are being posted to chatter and why? Perhaps there is another solution.

    • @JeremyBrowne-b9i
      @JeremyBrowne-b9i 11 місяців тому

      @@Rotive So what's happening is our finance team is providing pricing guidance on deals, in the form of two PDF files they give to the opportunity owner to then share with the prospect. The flow they are looking for in Salesforce is for the Finance rep to post attach the PDFs in a chatter post within the Opportunity, that will then send an email to the opportunity owner with the PDFs as attachments in the email. This way the opportunity owner can easily share the attachments with the prospect. As it is currently, the finance rep attaches the PDFs to a chatter post in the opportunity and the opportunity owner receives an alert to the chatter post, but must log into Salesforce to access the attachments. We want to make it more seamless for the opportunity owner to get the PDFs in front of the prospect.

    • @juanquintero-ld2py
      @juanquintero-ld2py 10 місяців тому

      @@Rotive ContentDocumentLink looks up to the file but it does not has an option to evaluate created date and name. I also need to pull only the latest file, but every time time I sorted it it attached ALL the files. Any ideas how to achieve this?

  • @shomailakhan2013
    @shomailakhan2013 Рік тому

    Mind blowing solution!! My recent favorite Salesforce channel!!

    • @Rotive
      @Rotive  Рік тому

      Thanks! That's nice very nice of you.

  • @pb9075
    @pb9075 11 місяців тому +1

    thanks for the video... everything worked well... but what if I want to select a document within few documents... or pick 2 documents among more documents...?

    • @NickStump2727
      @NickStump2727 11 місяців тому +1

      Great Question. We are wondering the same thing

    • @Rotive
      @Rotive  11 місяців тому

      Hey there! Check out my response to @user-tu8lb2jv7w. The key is to have the Get pull back multiple ContentDocumentLinks and then loop through them. You can use a Decision element in the loop to see that particular document matches your criteria, because you can evaluate the name of the file related to the ContentDocumentLink record in the loop

  • @approverman
    @approverman 10 місяців тому

    Such a great and usefull video! Many thanks for this!

    • @Rotive
      @Rotive  9 місяців тому

      Glad it was helpful, Christian!

  • @salmaabuzeid
    @salmaabuzeid 6 місяців тому

    Hello Brian,
    I searched for the better email option but it’s not there in actions. :/

  • @mohsarfaraj227
    @mohsarfaraj227 Місяць тому

    Thank you for sharing.
    Will it consume the Apex email daily limit?
    because I have seen apex email somewhere in the flow.

    • @Rotive
      @Rotive  Місяць тому +1

      I do think this will count against your daily Salesforce email limit of 5000.

  • @CharlieSides
    @CharlieSides Рік тому

    Thank you so much Brian. This solved a big challenge for me!

    • @Rotive
      @Rotive  Рік тому

      Glad it helped! Thank you for the comment, Charlie.

  • @SalesforceLeandra
    @SalesforceLeandra Рік тому

    This is incredibly helpful! Thanks so much Brian!

    • @Rotive
      @Rotive  Рік тому

      Glad it was helpful!

  • @leonardnethersole1901
    @leonardnethersole1901 6 місяців тому

    Great video although I seem to be falling into the same errors as many other people... the flow is working I receive an email but the attachment is not included. Has anyone gotten to the bottom of this our found a work around? Any help is appreciated!

  • @shomailakhan2013
    @shomailakhan2013 7 місяців тому

    Incredible!!! Thanks for sharing!!

    • @Rotive
      @Rotive  16 днів тому

      You're welcome! 😊

  • @AnnaSzabo
    @AnnaSzabo Рік тому

    What a great video, Brian! Thank you. I love your channel.

    • @Rotive
      @Rotive  Рік тому +1

      Thank you, Anna!

  • @dougoudou
    @dougoudou 6 місяців тому

    Hi Brian, thanks a lot for this video, that is super useful! is there a way to allow the user to choose which file he wants to send via a screen flow?

  • @kentfidler5922
    @kentfidler5922 4 місяці тому

    This is not working for me. It does not recognize my Get File action. It just says no data. Any idea why this might be?

  • @KarimahTijani
    @KarimahTijani 7 місяців тому

    Is there a way to configure so I will grab the most recent created attachment?

    • @Rotive
      @Rotive  7 місяців тому

      In the Get Content Document Link step, you can sort the get by Created Date and make it Descending. Then have the Get only return one record instead of all of them. This will return you the most recently created Content Document Link. This is the most recently added file, maybe not the newest file in the system.

  • @yoavkorn2642
    @yoavkorn2642 Рік тому +1

    this is great. Please do the same but with bulk email functionality.

    • @Rotive
      @Rotive  Рік тому

      Thanks for the comment! We'll add that video idea to our list. Appreciate it!

  • @KevinKlerkx
    @KevinKlerkx Рік тому

    Hi Brian,
    I like the better email functionality however, is it possible to do sort of a preview of the images that are attached to a record, then select which ones to attach and attach only those to the email?

    • @Rotive
      @Rotive  Рік тому

      I suppose you could in a Screen flow. You'll just need screens ahead of the send email action that lets you review and approve the attachment. Good idea!

  • @zhoushiyu2556
    @zhoushiyu2556 Рік тому

    It was great solution. But after I installed these two packages, there were no send better email option in my flow action selection box. It's really weird. Do you know what problem of it ?

    • @Rotive
      @Rotive  Рік тому +1

      Thank you for the comment! There are actually three packages you need to install: Flow Actions Base Pack, the Flow Screen Components Base Pack, and then the Send Better Email Package.

  • @AhsanMasood-n4e
    @AhsanMasood-n4e Рік тому

    Hi, I am trying to attach the files by taking the input from the user? Is screen flow the best for that and how do I call those files in my flow

    • @Rotive
      @Rotive  Рік тому

      The standard upload file component in a screen flow adds that file to a record once you progress to the next screen. It should provide the ID of the newly created Salesforce file for your use in the Flow automatically. Screen flow is a good option here.

  • @amolbhosale8818
    @amolbhosale8818 Рік тому +2

    I hve many times this concept pratics but result is always fail.... Then i watch u r video last 2hr back and finally done 👌🏻🥳🙏🎉 thanxs brian. ❤️

    • @Rotive
      @Rotive  Рік тому +1

      Glad it helped!

  • @freekflashion
    @freekflashion 10 місяців тому

    Hi Brian, thanks for your useful video. I want to get all files from the opportunity record and the most recent file from a related account with type 'x'. I can't find a way to include that logic in your 'Get File' component. Can you propose a solution for that? Regards, Freek

    • @Rotive
      @Rotive  8 місяців тому

      Hey Freek, I haven't used this action to send more than just 1 attachment at a time. You'll need to create a collection: either a record collection, or more likely a text collection with the IDs of all those Content Document Links. This one is tricky to explain over text. Consider joining our membership. This is the kind of thing we can walk through during Office Hours.

  • @awongff
    @awongff 8 місяців тому

    This seems like the perfect solution! All seems to be working but for some reason, the attachments appear as a .html file format instead of .pdf or .jpg
    Does the attachments only link to the Salesforce record for the attachment or is it meant to be the original file format?

    • @Rotive
      @Rotive  8 місяців тому

      Hi Andrew, Thanks for watching!
      The attachment should be a PDF, jpg, etc. I would double check what ID you're passing into the email action. It might not be correct. Are you finding the same issue with other files you're testing? Maybe this particular file has an issue (size, corruption, weird encoding?)

  • @katecantell
    @katecantell Рік тому

    Hi, Thank you for the video, I was able to attach the files needed, but I am having an issue with the email template working. I have tried many times to get this to work, read the pages, etc. and its not working with merge fields. What am I missing?
    Thank you!!

    • @Rotive
      @Rotive  Рік тому

      Hey Kate, I've run into issues with the Send Better Email component before that I couldn't figure out. I would try deleting the component from your flow and adding it again and filling out the values again. It might be a bug if you're confident you have the right template id or template api name included.

  • @jamesbuggenhagen4936
    @jamesbuggenhagen4936 Рік тому

    Thanks for sharing Brian. Quick question. How can I give management confidence in downloading something into our Org that is not on the app exchange? Could there be any security concerns with downloading something from UnofficialSF? Thanks again!

    • @Rotive
      @Rotive  Рік тому +1

      Good question. Yes, there is a risk in downloading and running anything off UnofficialSF. It hasn't been reviewed by Salesforce's security team. Much of this code is publicly visible on Github but that's no guarantee. It's a reasonable concern.

  • @vasundarap
    @vasundarap 8 місяців тому

    Hey Brian, this video is very helpful and very clear to the point. My flow worked and I got the email but there was no attachment. In debug I do see that the file was found. Any idea why this happened.

    • @Rotive
      @Rotive  8 місяців тому

      I would make sure you're getting that Content Document Link ID and not using the Content Document ID accidentally. I've also ran into bugs with this action before. Sometimes you have to delete that step and add it back to fix issues.

  • @cassioorsi
    @cassioorsi Рік тому

    Is there a way to create a CSV file and then send it in Flow?
    In this case the file doesn't exist in Salesforce, so I can't reference a Content Document id.

    • @Rotive
      @Rotive  11 місяців тому +1

      Hey Cassi, check out this Flow Action: unofficialsf.com/enhanced-generate-csv-file-from-record-collection-action/ I haven't tried it yet. Please let me know if works for you. This could be a great solution for people that need to send data to colleagues or partners outside of Salesforce.

  • @DanielBenisty-v3g
    @DanielBenisty-v3g Рік тому

    Hi Brian, Great Video. Can you please explain how to add an email template? for some reasons I cannot link between the two. Thank you!

    • @Rotive
      @Rotive  Рік тому

      You have to use that email template's record ID. You'll find it in the URL if you have the template record open. I've also ran into bugs with this sometimes. I would try deleting the element and then adding it back to the flow.
      Also, if you don't need the attachment functionality, consider using the default Send Email action. It now accepts email templates since a recent update.

  • @maichimai5320
    @maichimai5320 Рік тому

    How to use the tool above to get report file from Report? I want to send a daily report as attachment to outbound email (the receiver is does not have Salesforce license to subscribe daily report)

    • @Rotive
      @Rotive  Рік тому

      Hey there, I think this video will help you out: ua-cam.com/video/WfOAkDVM7DU/v-deo.html

  • @raquelriemer6563
    @raquelriemer6563 9 місяців тому

    Great video however for some reason when the email is delivered there is no attachment. I browsed through the documentation and I am not sure I fall under any of the troubleshooting.
    When I debug I see it is pulling the content ContentDocumentLink because I see the id and if i add another document I see the second id. I thought maybe my Spam filter dropped the attachment so I tried other emails, still no attachment? any ideas??

    • @Rotive
      @Rotive  9 місяців тому

      That is interesting... You've already checked debug, which is where I would start and see those IDs. Could it be the type of file? What if you try some different records and files? Perhaps the attachment is too big or it's an unsupported file type.

    • @raquelriemer6563
      @raquelriemer6563 9 місяців тому

      @@Rotive PDF I am looking into documentation regarding the sharing of files.

  • @MrPaulohow
    @MrPaulohow 11 місяців тому

    Hi Brian, how are you doing? Do you know if the organization needs settings for the attachment? My email is sending, but without the attachment. In the Debug, the File is getting correct, but doesn't send. I adjusted the attachment size in the org settings to the maximum, but it doesn't work yet. Help me guyssss

    • @Rotive
      @Rotive  11 місяців тому +1

      Hey Paulo, I'm really good. Thanks! I haven't run into a size issue, but that's a good thought. To troubleshoot, I'd use a small file. Any luck?

    • @Rotive
      @Rotive  11 місяців тому +1

      Now that I think about it. Try deleted the Send Better Email action and adding it again. I've run into bugs without before. Deleting and adding it back have helped. Make sure you know all the values you need, because you'll have to set them again.

  • @mikeprice2200
    @mikeprice2200 Рік тому

    Followed the instructions, but every time I try to use it in a flow, I get an error and it will not save the flow.

    • @Rotive
      @Rotive  Рік тому

      Can you tell me what the error says?

  • @otenis2008
    @otenis2008 8 місяців тому

    Has anyone had the problem of the email not attaching more than one file? I. E. collection with only one entry will attach and send, more than that will not attach. The user debugging the flow is admin, so I am at a loss of if it is some sort of permission limitation or malformtion of the outputs.

    • @Rotive
      @Rotive  8 місяців тому

      Hey, this shouldn't be a permissions issue. It's possible that you're using a Record Collection and not a Text Variable Collection. I'm not 100% sure, but I bet you need to use the latter. Once you get all those Content Document Links, loop through them adding the ID of each one to a text variable collection. Then reference your text variable in the action.

  • @NickStump2727
    @NickStump2727 11 місяців тому

    Has anybody figured out how to sort which file you want to send? I have multiple files but only want to send one.

    • @Rotive
      @Rotive  11 місяців тому

      Hey Nick, Check out my response below to @user-tu8lb2jv7w. Please reply there with any questions, we can keep one thread to help future viewers. Thanks for watching!

  • @sofiane130819841
    @sofiane130819841 9 місяців тому

    Usefull

    • @Rotive
      @Rotive  9 місяців тому

      Glad you think so!

  • @ghoshdipan891
    @ghoshdipan891 7 місяців тому

    This looks great but it makes me think that won't it be internally calling the apex Messaging class??? This defeats the whole purpose of using flow cause it will hit the 5000 daily limit through apex

    • @Rotive
      @Rotive  7 місяців тому

      Hey there! You are right, the standard 5000 email limit would still apply since we're sending the email from Salesforce's servers. Are you running into that limit? Have you asked Salesforce to raise the limit for you? Worth submitting a case to see if they'll do it.

    • @ghoshdipan891
      @ghoshdipan891 7 місяців тому

      @@Rotive Does they charge additionally for increasing the limit? We run on the performance edition

  • @leonardnethersole1901
    @leonardnethersole1901 6 місяців тому

    Responding to my comment below with the solution!
    "Great video although I seem to be falling into the same errors as many other people... the flow is working I receive an email but the attachment is not included. Has anyone gotten to the bottom of this our found a work around? Any help is appreciated!"
    If you have the same issue please read this comment!
    You must send the "content document link" get records element collection variable through a loop element. In that loop element ADD the current item in the loop to a new resource variable. The resource variable should be
    - Data type - record
    -Allow multiple values(collection) - Check
    - Object = Content Document Link
    - Available Outside the Flow - available for output
    In the unofficial salesforce better email action use the newly created resource variable which is described above in the attachments section. Hope this helps save people some time! 😀

  • @kunalmarathe1855
    @kunalmarathe1855 Рік тому +1

    Email receives But Without Attachment

    • @Rotive
      @Rotive  Рік тому

      You'll have to dig into the debug log to see if the file exits/the Get is finding it.

    • @esi-junemitteeadabunu8980
      @esi-junemitteeadabunu8980 Рік тому

      @@Rotive Does this mean that the email can be sent even if there is not an attachment. I ask because I have a use case where some people will attach files but others will not. It would be great to just use one email.

    • @otenis2008
      @otenis2008 8 місяців тому

      Has anyone had the problem of the email not attaching more than one file? I. E. collection with only one entry will attach and send, more than that will not attach. The user debugging the flow is admin, so I am at a loss of if it is some sort of permission limitation or malformtion of the outputs.

  • @juanquintero-ld2py
    @juanquintero-ld2py 10 місяців тому

    This doesn't not work with opportunities.

    • @Rotive
      @Rotive  8 місяців тому

      Object should matter. The principle is the same, though perhaps there are permission issues.