twenty icon indicating copy to clipboard operation
twenty copied to clipboard

Add CSV import for any object

Open FelixMalfait opened this issue 1 year ago • 4 comments

What we want

We had previously built a feature to import a CSV or spreadsheet of companies/people directly into Twenty. This feature is live and works well, but since then we have moved to a generic framework where object names and properties are abstracted and driven by the backend. Users can now create any type of object.

The CSV import feature was not refactored does not rely on the new metadata framework. Therefore it's not possible to import a custom field via the csv import. Or to enable the import feature on custom objects.

See:

  • https://github.com/twentyhq/twenty/blob/main/packages/twenty-front/src/modules/companies/hooks/useSpreadsheetCompanyImport.ts
  • https://github.com/twentyhq/twenty/blob/main/packages/twenty-front/src/modules/people/hooks/useSpreadsheetPersonImport.ts

We need to abstract these two files on a single generic hook that takes the object name as parameter, and map the according fields (probably retrieved though useObjectMetadataItem - tbc).

Screenshots

This is the current state of the product. Nothing would really change from a UI perspective even though this is a frontend ticket. But we need to have the "options > import" button on every object, including custom objects. And during field mapping we will now see every custom field, not just the standard pre-created fields .

Screenshot 2024-01-05 at 09 41 01 Screenshot 2024-01-05 at 09 40 56

FelixMalfait avatar Jan 05 '24 08:01 FelixMalfait

Hey @FelixMalfait, @charlesBochet I really want to take this up? Can I, please?

mustajab-ikram avatar Jan 05 '24 14:01 mustajab-ikram

@mustajab-ikram yes obviously that would be fantastic! thanks

FelixMalfait avatar Jan 05 '24 14:01 FelixMalfait

@mustajab-ikram Are you working on this? If not, maybe I can take this up.

i-am-chitti avatar Jan 18 '24 17:01 i-am-chitti

This is a relatively though one, quite a lot of abstraction needed to make this work elegantly! (e.g. complexity with full name = first name + last name). @mustajab-ikram did you give it a try already?

FelixMalfait avatar Jan 18 '24 20:01 FelixMalfait

@quest-bot stash 250

FelixMalfait avatar Feb 01 '24 08:02 FelixMalfait

New Quest! image New Quest!

A new Quest has been launched in @twentyhq’s repo. Merge a PR that solves this issue to loot the Quest and earn your reward.


Loot of 250 USD has been stashed in this issue to reward the solver!

🗡 Comment @quest-bot embark to check-in for this Quest and start solving the issue. Other solvers will be notified!

⚔️ When you submit a PR, comment @quest-bot loot #3247 to link your PR to this Quest.

Questions? Check out the docs.

quest-bot[bot] avatar Feb 01 '24 08:02 quest-bot[bot]

@quest-bot embark

brendanlaschke avatar Feb 01 '24 14:02 brendanlaschke

@brendanlaschke has embarked on their Quest 🗡

  • @brendanlaschke has been on GitHub since 2019.
  • They have merged 76 public PRs in that time.
  • Their swords are blessed with JavaScript and HTML magic ✨
  • They have contributed to this repo before.

Questions? Check out the docs.

quest-bot[bot] avatar Feb 01 '24 14:02 quest-bot[bot]

🧚 @brendanlaschke has submitted PR https://github.com/twentyhq/twenty/issues/3756 and is claiming the loot.

Keep up the pace, or you'll be left in the shadows.

Questions? Check out the docs.

quest-bot[bot] avatar Feb 06 '24 15:02 quest-bot[bot]

Quest solved! image Quest solved!

Congratulations! Your efforts have paid off. A PR that solves this Quest has been merged.


@brendanlaschke, you have been victorious in Quest #3247 🗡

💰 To claim your $250 reward follow instructions here

🧚 Thanks to all bold adventurers for attempting this quest! Sign-up to Quine.sh to access more exciting Quests like this one ⚔️

This Quest is now closed ✨

Questions? Check out the docs.

quest-bot[bot] avatar Feb 07 '24 22:02 quest-bot[bot]