Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Option to export colId as header in CSV / XSLX instead of label (#688) #692

Merged

Conversation

fflorent
Copy link
Collaborator

@fflorent fflorent commented Oct 12, 2023

Context

Quoting @vviers in #688 :

We do a lot of downloading CSV from Grist in order to integrate data tables to a downstream data platform, and it's a little painful that the column names are human-friendly labels instead of the more machine-friendly colId.

This also defeats the purpose of disconnecting the column label from colId since any renaming of a column in a Grist doc breaks our ETL system if we forget / aren't told to update it as well (this would not happen if we relied on colId and disconnected them from labels*).

My idea is to add a new option to the download/csv endpoint (and to download/xlsx as well if you wish though I think less developers / automated systems would be impacted by this) in order to add the option of getting the file with colId instead of labels.

Solution

Add a ?colIdAsHeader=true|false ?header=colId option to both CSV and XLSX exports for that purpose.

resolves #688

@fflorent fflorent changed the title Issue 688 col id in csv Option to export colId as header in CSV / XSLX instead of label (#688) Oct 12, 2023
@fflorent fflorent force-pushed the issue-688-colId-in-csv branch from f77c789 to 2fce0e2 Compare October 12, 2023 14:55
@dsagal
Copy link
Member

dsagal commented Oct 12, 2023

Given the wish in #690 to allow using persistent numeric IDs in the API (for tables, but could later be supported for columns too), might it make sense to have the option as headers=<label|colId> for the feature in this diff, and later add additional choices of skip and colRef (for numeric IDs)?

@fflorent
Copy link
Collaborator Author

@dsagal I hesitated with this option, and you have fair points in favor for this change!
Done :)

@fflorent fflorent requested a review from dsagal October 13, 2023 18:08
@georgegevoian georgegevoian requested review from georgegevoian and removed request for dsagal October 13, 2023 20:09
Copy link
Contributor

@georgegevoian georgegevoian left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @fflorent!

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.

Download with colId instead of label
3 participants