Skip to content

feat: add relation lookup column type - #2271

Open
Koc wants to merge 2 commits into
mainfrom
feature/add-lookup-column-type
Open

Koc wants to merge 2 commits into
mainfrom
feature/add-lookup-column-type

Conversation

@Koc

@Koc Koc commented Jan 19, 2026 •

Copy link
Copy Markdown
Contributor

This is continuation of #2248 that allows to display more column from relation table.
There are 2 tables: employees and vacations. We can add vacation.requester relation column that referenced to the row id of the employee and display employee.name. But what if we need to display more column from the related table? e.g. employee.department. That's where relation lookup can help: select already existent relation and choose what extra column should be displayed.

🖼️ Screenshots

image

image

🗒️ TODO

@Koc Koc changed the title Feature/add lookup column type feat: add lookup column type Jan 19, 2026
@Koc
Koc changed the base branch from main to feature/add-relations-column-type January 19, 2026 16:47
@Koc
Koc force-pushed the feature/add-lookup-column-type branch 3 times, most recently from abbdf56 to 30a0005 Compare January 19, 2026 17:46
@Koc Koc mentioned this pull request Jan 20, 2026
1 of 2 tasks
@Koc Koc added the enhancement New feature or request label Jan 21, 2026
@Koc
Koc force-pushed the feature/add-relations-column-type branch 2 times, most recently from f34f8f9 to d406233 Compare January 25, 2026 12:47
@Koc
Koc force-pushed the feature/add-relations-column-type branch 5 times, most recently from 502b69b to 8093d63 Compare February 15, 2026 16:40
@Koc
Koc force-pushed the feature/add-relations-column-type branch 7 times, most recently from d45b95c to cb637bd Compare February 28, 2026 18:32
@enjeck
enjeck force-pushed the feature/add-relations-column-type branch from cb637bd to 9b36f43 Compare March 4, 2026 04:59
@Koc
Koc force-pushed the feature/add-relations-column-type branch 3 times, most recently from b47617a to 3240639 Compare March 25, 2026 23:07
@enjeck
enjeck force-pushed the feature/add-relations-column-type branch from 3240639 to 0cdfefa Compare April 23, 2026 03:47
@Koc
Koc force-pushed the feature/add-relations-column-type branch 3 times, most recently from b707106 to f3c29d8 Compare May 4, 2026 21:45
@Koc
Koc force-pushed the feature/add-relations-column-type branch from f3c29d8 to b426237 Compare May 7, 2026 14:05
Comment thread src/modules/modals/CreateRow.vue Outdated
Comment thread src/shared/components/ncTable/mixins/exportTableMixin.js Outdated
@Koc
Koc force-pushed the feature/add-lookup-column-type branch 4 times, most recently from e3d186a to dd0bdd6 Compare July 25, 2026 13:43
@Koc

This comment was marked as resolved.

@Koc
Koc force-pushed the feature/add-lookup-column-type branch from dd0bdd6 to af54364 Compare August 24, 2026 22:06
@enjeck

enjeck commented Aug 29, 2026

Copy link
Copy Markdown
Contributor

That's where relation lookup can help: select already existent relation and choose what extra column should be displayed.

Having a relation column, and a lookup column is extremely confusing. Even with this, I had to think extra hard to understand how they're different. If I'm struggling to understand as the dev, I doubts users will easily get it (or maybe it's just me, lol).

I would need others to check if they understand this just from the description and images. Maybe @nextcloud/designers need to weigh in

@Koc

Koc commented Aug 30, 2026 •

Copy link
Copy Markdown
Contributor Author

well, that's pretty similar to Excel's VLOOKUP function. But I'm open to changes here, let's wait for our designers

@Koc
Koc force-pushed the feature/add-lookup-column-type branch 5 times, most recently from 9667d06 to e7ff045 Compare August 30, 2026 12:05
Comment thread src/shared/components/ncTable/partials/TableCell.vue Outdated
@kra-mo

kra-mo commented Aug 31, 2026

Copy link
Copy Markdown
Member

I certainly think the names should be changed at least. @marcoambrosini, ideas?

Let's also just say that Excel's ancient statistics-oriented DSL is maybe not the best language to draw inspiration from when it comes to design ;)

@marcoambrosini

marcoambrosini commented Sep 3, 2026 •

Copy link
Copy Markdown
Member

the "Lookup" term is used for this in both Baserow and Airtable. For the relational ones they use the wording "Link to table". I would do the same

Maybe this can help: https://baserow.io/user-docs/lookup-field

@samin-z
samin-z self-requested a review September 8, 2026 08:20
Comment thread src/shared/components/ncTable/partials/TableCell.vue Outdated
@Koc
Koc force-pushed the feature/add-lookup-column-type branch from e7ff045 to 8920bc5 Compare October 9, 2026 17:31
@Koc

Koc commented Oct 9, 2026

Copy link
Copy Markdown
Contributor Author

@samin-z I've rebased branch, fixed conflicts and code review comments, pipeline, added new tests.

Koc added 2 commits October 14, 2026 22:01
Signed-off-by: Kostiantyn Miakshyn <molodchick@gmail.com>
Signed-off-by: Kostiantyn Miakshyn <molodchick@gmail.com>
@jospoortvliet

jospoortvliet commented Oct 25, 2026 •

Copy link
Copy Markdown
Member

Team, in case it helps - a real-world use case from within Nextcloud, maybe relevant for the design discussion on this lookup/show a field of the linked row thing.

We track press coverage in Tables: one row per article (~2,400 rows), and a separate "PR Outlets" table with one row per outlet (website, YouTube channel, print title) holding Audience, Tier, Vertical and Country. Classification is per outlet, so every article should show its outlet's values.

Over the weekend I wrote a script that copies these values over via the API because there's no built-in mechanism in Tables.

What we would need from lookups;

  • Show several fields of the linked row as their own columns (Audience, Tier, Vertical, Country).
  • Use them in view filters and sorting (e.g. "Tier = T1", "Country = Germany") and, if possible, in Nextcloud Analytics.
  • Export them as values in CSV/API, not row IDs.
  • Lookups of lookups: Country links to a Countries table that holds the reporting Region, so article → outlet → country → region.

Then, another thing: live vs frozen values. When we re-classify an outlet from Tier 3 to Tier 2, we'd like old rows to change. I guess it works that way, but I just want to clarify...

wrt naming, "Link to table" + "Lookup" (as in Airtable/Baserow) would be clear to me at least...

@samin-z can show you our tables if you want ;-)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants