GitMurf / csv-to-roam-table-md

Prepare/convert your CSV tables to be ready to import into your Roam Research database.
MIT License
8 stars 1 forks source link

Convert CRM CSV into Roam pages with attributes based off columns #1

Open GitMurf opened 4 years ago

GitMurf commented 4 years ago

Is your feature request related to a problem? Please describe.

No problem. Just enhancement idea.

Describe the solution you'd like

Describe alternatives you've considered

Do I integrate this into this current script? Or do I create a separate script to handle this as two distinct use cases? Maybe for now do as separate script but then as future goal, and when add a GUI etc. then combine into one script.

Additional context

DETAILS from Rob's requests/ideas:

Imagine exporting a CRM from airtable into CSV, taking the first column as the name column, making pages for each of them, and then each column after that gets placed onto each page as attributes. Voila, your personal CRM just got exported to Roam while maintaining its data integrity!

And here’s documentation on attribute tables in Roam for people who are going to be trying it out as a result of this script: https://roamresearch.com/#/app/help/page/LJOc7nRiO

one more request: currently, metadata works in sort of a tricky way where which approach you use determines whether you can use them for tables or for query based workflows, you kind of need to pick one. Would you please make a version where all metadata goes into a block like in Approach 3 in this image?

image

See that only Approach 3 comes up with that correct query result, whereas Approach 1 is what somebody would use to make an attribute table

GitMurf commented 4 years ago

I’ll do you one better. I’ll just ask for input from the user when they run the script whether they want the metadata indented under another bullet or not. I’ll start simple though and just get the concept working and then can make more robust with user input options etc.

GitMurf commented 4 years ago

REQUIREMENTS:

@ RobH Did I miss anything?

phhq commented 4 years ago

REQUIREMENTS:

  • For each item in column 1, create a new .md page.

Since page names have to be unique:

  • On each page you create an attribute for each column 2-n for example Column2Header:: Column2Value

yes, perfect. consider one additional attribute at root level which is the "type" for the whole page. example:

[[Marvin the Martian]]

    page type:: [[contact card]]
    column 2-n heading:: [[column 2-n value]]
    etc.
  • Script asks you whether you want to have attributes under root level of page OR whether want to nest under a specific bullet like [metadata] or [metadata] for [[books]] ... you can change default variable in script to be whatever you want but my script’s default will just be [metadata] and each run of the script you have option to use default or customize it on the fly.

@ RobH Did I miss anything?

This looks great, I like the option to put in root directory or use [metadata] at first bullert. only comment is to consider allowing user to add a field for [[date imported]], since the page data for that is not easily accessible (that I know of).

Thanks. E

classicrob commented 4 years ago

I'd like the option to have all metadata instead encoded as "BoldedAttrText: Property BoldedAttrText: Property"

But all within the same block so it can be queried more effectively.

For the versions with Attributes (for the sake of attribute tables), something that would likely be helpful would be to have one attribute be the title of the CSV.

For example: "csvtitle"::

This would allow people to make attribute tables in Roam for specific tables, because if certain attributes overlap from table to table then Roam will just gather in everything, which is sort of unwieldy.

{{attr-table: [[csvtitle]]}}

classicrob commented 4 years ago

One more thing: if the column in the Airtable has multiselect, then I would like it so each option within the multiselect gets wrapped in double brackets when it's being put into the markdown file.

phhq commented 4 years ago

I'd like the option to have all metadata instead encoded as "BoldedAttrText: Property BoldedAttrText: Property"

But all within the same block so it can be queried more effectively.

For the versions with Attributes (for the sake of attribute tables), something that would likely be helpful would be to have one attribute be the title of the CSV.

For example: "csvtitle"::

This would allow people to make attribute tables in Roam for specific tables, because if certain attributes overlap from table to table then Roam will just gather in everything, which is sort of unwieldy.

{{attr-table: [[csvtitle]]}}

yes, good idea. you could have an attribute like

from csv:: [[CSV file name]]

I also like the idea of allowing the options to put attributes and values in one block or one per block.

Finally, if you want to go hog wild, you could create a summary page for the CSV converesion to markdown itself as a markdown page , eg

"CSV Conversion-Date-Filename" as the page name

BTW, this summary page is not necessary, for me just would be nice.

GitMurf commented 4 years ago

Wow awesome feedback @phhq and @classicrob ! I think I am going to break these into chunks and make them their own "Issues" in github that way as I develop each one, we can discuss as you test each one and have specific commentary for each idea you listed here. Thanks!

GitMurf commented 4 years ago

Ok made all these comments into their own separate issues:

@classicrob here are yours for reference:

@phhq here are yours for reference:

If I missed anything let me know!!