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

feat: add relation lookup column type#2271
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
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
@Koc
Koc force-pushed the feature/add-lookup-column-type branch 5 times, most recently from a94d637 to ac1036d Compare July 15, 2026 22:58
@Koc Koc changed the title feat: add lookup column type feat: add relation lookup column type Jul 19, 2026
@Koc Koc mentioned this pull request Jul 19, 2026

@enjeck enjeck left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Even with the screenshots, I'm not sure what we're adding and what the usecase is?

@Koc

Koc commented Jul 20, 2026

Copy link
Copy Markdown
Contributor Author

@enjeck I've updated description:

There are 2 tables: employees and vacations. We can add vacation.requester relation column that referenced to 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.

Comment thread src/modules/modals/CreateRow.vue Outdated
Comment on lines +66 to +71
if (column.type === ColumnTypes.RelationLookup) {
rowData[column.title] = this.getRelationLookupValue(column, row, dataStore)
} else {
const set = row.data ? row.data.find(d => d.columnId === column.id) || '' : null
rowData[column.title] = set ? column.getValueString(set) : ''
}

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

try to omit if/else and move functionality to the column class

@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

Signed-off-by: Kostiantyn Miakshyn <molodchick@gmail.com>
@Koc
Koc force-pushed the feature/add-lookup-column-type branch 4 times, most recently from 4362724 to 9667d06 Compare August 30, 2026 12:04
Signed-off-by: Kostiantyn Miakshyn <molodchick@gmail.com>
@Koc
Koc force-pushed the feature/add-lookup-column-type branch from 9667d06 to e7ff045 Compare August 30, 2026 12:05
- SPDX-License-Identifier: AGPL-3.0-or-later
-->
<template>
<component :is="cellComponent"

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

replaced with a simple function

@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

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.

4 participants