Excel export - split linked records to multiple rows

The current excel export of a table puts all values of a linked record column in 1 rowfield, example
This line in a table

becomes in excel

To process the structured data in Excel or other applications it would be good when the linked records are splitted into multiple rows, like:

May an export option can be added to enable this export behaviour

Thank you

Thanks for the feature request. We’ll think carefully about that.

1 Like

If you think about this topic, maybe you can add an option, to display each value in a new line in one cell. You can “force” seatable to do this, if you adjust the size of the column, but this is more a workaround.

Standard:
image
Small Column Size:
image

But this only works for short values

Nico, The reason of splitting records with mutliple connected linked records in multiple lines is the need of getting a structured dataset. Same as you do a join on a database level. in the moment you have multiple linked records, also the mainrecord will be multiplied. This is crucial then for the elaboration of the data in excel or other applications.
Thanks, Gino

@gino909 I understand your argumentation. But usecases are diffrent and adding this as an OPTION, maybe with the note, that this will destroy the export ect. would be a good thing.
Greetings Nico

Hi
Any movement on that issue?
As mentioned it would be great when records with multiple values in a cell would be splitted to multiple records when exporting to Excel. This for example is needed when you want to create a report in Excel, all values in 1 cell makes this impossible.

Please let me know, thank you

Hi, thanks for your patience. This feature is still not available, sorry.
With the new 2.4 now you can create a new table with Excel, or add new data from an Excel file with the same headings. This makes SeaTable more compatible with Excel.

To split records with multiple links into separate records, perhaps you could try the JavaScript or other programming workarounds!

Well, I am not sure if we should develop a dedicated export function in Javascript or Python. Also doing that after export to excel seems not possible anymore, because since recently the values in a cell are no more separated by a newline tag and also a separator as for example a semicolon is missing

Do you have planned to put that option of “structured data export” on the roadmap?

Thanks

You can write a simple JavaScript in SeaTable to read the number of items in each row’s link column and create a new row for each item in a new table, and then export that table.

For example, a row has three links, this script can easily create 3 new rows each with a different link item and all the other columns are identical. Iterate through your table and the other table is exactly what you need to export to Excel as-is.

As SeaTable provides JavaScript and Python scripts, there’s a lot of room for very specific needs, and it’s much more practical to spend half an hour to write such a script than to wait for a ready-to-use feature. Kindly understand that, if something is doable with the SeaTable Scripts, it’ll always have a low priority on our developing list.

Furthermore, our developing focus is on how to migrate from other solutions to SeaTable, not the other way around.

This is an example Python script to do the task:

# This script reads the "Link" column of "Table1" and creates a new record in "Table1-1" for each linked item.
# After executing this script, you'll have more rows in "Table1-1" than "Table1", because each row has been multiplied by the number of its linked items.

# Preparation and authentication
from seatable_api import Base, context
server_url = context.server_url 
api_token = context.api_token
base = Base(api_token, server_url)
base.auth()

# Save all the rows of "Table1" into the "rows" object
rows = base.list_rows('Table1')

# For each row in "Table1", look into its "Link" column and for each element there, create a new row in "Table1-1", saving the "Name" of the linked record into the "Link" column (made as text type).
for x in rows:
    links = x["Link"];

# If the link column is empty, also copy it to "Table1-1"
    if links ==[]:
        base.append_row("Table1-1", x);
# If the link column is not empty, create an entry for each element
    for r in links:
        linked_row = base.get_row("Table1", r);
        x["Link"]=linked_row["Name"];
        base.append_row("Table1-1", x);

Visit SeaTable Programming Manual for more instructions.

2 Likes

Thank you
I already started doing some tests yesterday. Looks goods. I am not that happy having additional tables as workaround, but definitely it will work. Thank you for the example script.
You can close this issue
Best