top of page

Create CSV file from Record collection in Flows!

Jun 4, 2020
1 min read

Hi there! Good to see you 😀

In one of my recent article, I shared about an Apex action for flows that we can use to create records directly from a CSV file. In this article, we’re going to see the exact opposite of it, i.e. an Apex action that allows you to create a CSV file from a list(collection) of records in flows.

Here is the link to the unmanaged package that you can install directly in your org: https://login.salesforce.com/packaging/installPackage.apexp?p0=04t6F000003zHeH

If you are interested in the code, you can refer to the Github repo here.

Usage Considerations:

  1. This action will only work when all the fields are included in the records. So make sure to select ‘Automatically store all fields’ when using Get records to fetch records.

Flow Action Inputs:

  • Object API Name

  • List of records

  • Save file with name: This will be the name of the saved CSV file.

  • Add time stamp to the file name? : When true, the name of the file will automatically appended by the current date and time.

Flow Action Output:

  • ContentDocument ID for the uploaded CSV file.

Demo!

NOTE: My action is rather a simple one and doesn’t offer too much options for customization. If you’re looking for something with more options I’d recommend checking out a bit more enhanced action by Adam White!

Hope you find this useful! See you in the next one! ✌ Thank you for being an awesome reader! Subscribe to this blog for receiving all the latest updates straight to your inbox. 🙂

 
 
 

Comments


bottom of page