Skip to content

Feat: Add export to CSV support#292

Merged
scastiel merged 6 commits intospliit-app:mainfrom
yuvarajsai:feat/csv-support
Apr 19, 2025
Merged

Feat: Add export to CSV support#292
scastiel merged 6 commits intospliit-app:mainfrom
yuvarajsai:feat/csv-support

Conversation

@yuvarajsai
Copy link
Copy Markdown
Contributor

@yuvarajsai yuvarajsai commented Jan 6, 2025

Feature Enhancement: Export Group Data to CSV

This pull request introduces a new feature that allows users to export group data as a CSV file. The feature enhances accessibility and usability by providing an easily shareable and analyzable data format.

Addressed Issue: Feature request: Export Data as a User-Friendly CSV File (similar to Splitwise) #282

Key Features

  • CSV Export Functionality: Users can export group expenses to a CSV file with a single click.
  • Comprehensive Data Structure: The exported CSV includes:
    • Date: When the expense occurred.
    • Description: Details of the expense.
    • Category: Expense category.
    • Currency: Currency used.
    • Cost: Total amount of the expense.
    • Is Reimbursement: Whether the expense is a reimbursement or not.
    • Split mode: The method used to split the expense (e.g., Evenly, By shares, By percentage, By amount).
    • Participants: Individuals involved in the expense.

Benefits

  • Improved Accessibility: Simplifies access to expense data for non-technical users without requiring JSON parsing.
  • Enhanced Data Analysis: Enables users to perform detailed analysis and reporting using spreadsheet tools like Excel or Google Sheets.
  • Seamless Sharing: Provides a universally accepted format for easy sharing with group members or other stakeholders.

Implementation Details

  • CSV Conversion: The conversion is handled using the @json2csv/plainjs package, ensuring a clean and accurate CSV output.
  • Participant Shares Converted to Amounts: For better readability, the participants’ shares are converted into their respective amounts in the CSV file.
  • UI Enhancements: To prevent overwhelming the user interface, the "Export to JSON" and "Export to CSV" options are now hidden under a dedicated "Export" button.
  • File Naming: The exported CSV file is named using the group name and the date of export, and it is saved with a .csv extension.
  • No Changes to Export to JSON: The "Export to JSON" flow remains unchanged and continues to function as expected.

Screenshots:

image

CSV file opened in Excel:
image

@yuvarajsai
Copy link
Copy Markdown
Contributor Author

@scastiel, can you please review this when you get a chance?

@sir-argupta
Copy link
Copy Markdown

sir-argupta commented Feb 8, 2025

@yuvarajsai
Thanks, this was really needed. By the way I've very small suggestion if possible can you please reduce space between button and edge of the popup menu. Something like this..!?
image

image

@scastiel
Copy link
Copy Markdown
Member

Thanks @yuvarajsai!

@scastiel scastiel merged commit 6c5c9d5 into spliit-app:main Apr 19, 2025
1 check passed
@Eduardo3382
Copy link
Copy Markdown

Excellent!!! Thanks

Lipkin10 pushed a commit to Lipkin10/Split-AI-first-version that referenced this pull request Jul 30, 2025
* install json2csv package

* add necessary labels

* add support convert the JSON to redable CSV format and export

* add a popover to export btton and provide options for exporting to JSON and CSV

* Use a DropdownMenu

* Translations

---------

Co-authored-by: Sebastien Castiel <sebastien@castiel.me>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants