This custom action allows you to retrieve data from a Firestore collection and download it as a CSV file.

Code Compilation

CleanShot 2024-05-16 at 00.50.27.png

Before using this custom action, you need to compile the code. Follow these steps:

  1. Find the "Firestore CSV Exporter" action in the FlutterFlow Marketplace.
  2. Add the code to your project.
  3. In the FlutterFlow action editor, select "Custom Action".
  4. Choose the "generateAndDownloadCsv" action code.
  5. Click the "Compile" button to compile the code.

Once the code is compiled, the action will be available for use.

Preparation

As csvHeaderTitles and firestoreFieldNames vary depending on the collection, it is recommended to define them as constants within your app. For example, you can create a constants.dart file and define them as follows:

CleanShot 2024-05-16 at 00.39.22.png

Using these constants will make the action calls more concise.

Usage

To use this action, set it up in the FlutterFlow action editor as follows:

  1. In the action editor, select "Custom Action".
  2. Choose the "Firestore to CSV Download" action.
  3. Set the following parameters:

Parameter Description