Skip to content

feat: allow multiple values on relation columns - #2979

Open
he-is-talha wants to merge 4 commits into
nextcloud:mainfrom
he-is-talha:feat/2952/relation-multiple-values
Open

feat: allow multiple values on relation columns#2979
he-is-talha wants to merge 4 commits into
nextcloud:mainfrom
he-is-talha:feat/2952/relation-multiple-values

Conversation

@he-is-talha

Copy link
Copy Markdown
Contributor

Summary

  • Add a Select multiple items option on relation columns (customSettings.allowMultiple)
  • Store relation values as one cell row per related id (same pattern as usergroup)
  • Update create/edit UI, cell display, validation, import parsing, and analytics formatting for single and multi relations

Closes #2952

🖼️ Screenshots

image image image

Notes

  • API cell values for relation columns are now always int[] (legacy scalars are still accepted and normalized)
  • No DB migration; existing single-value cells continue to work

🤖 AI (if applicable)

The content of this PR was partly using AI

… Updated related components and services to handle multiple relation values, including UI adjustments for selection and display. Added tests to verify correct formatting of multiple relation values in analytics.

Signed-off-by: Talha Bin Yousaf <talhayousaf4420@gmail.com>
@samin-z

samin-z commented Sep 9, 2026

Copy link
Copy Markdown
Contributor

@he-is-talha please clean you second commit message before merging.

Keep only the first related id per row when switching to single-select,
fix multi filters / API scalar shape, and soften CSV import parsing.

Signed-off-by: Talha Bin Yousaf <talhayousaf4420@gmail.com>
@he-is-talha
he-is-talha force-pushed the feat/2952/relation-multiple-values branch from 9b6cdef to 888a5f9 Compare September 9, 2026 10:40
@he-is-talha

Copy link
Copy Markdown
Contributor Author

@samin-z Cleaned the second commit message and force-pushed.

@samin-z

samin-z commented Sep 9, 2026

Copy link
Copy Markdown
Contributor

few points:

  1. for multiple item when column is edited and it is switched to single item, table still shows multiple items until page is refreshed and then the correct value is shown.
  2. editing multiple items and switching to single item, it shows no warning that existing data might be loss so maybe a nice addition to let users know, or show a warning underneath this option in regard to how toggling this will effect.
  3. when the column is mandatory, clearing the relation still save with no error, it's better to make sure empty values are rejected both in the UI and on the API. same point for multi-selection, empty array shouldnt count as a valid value. Inline cell edit should also refuse to clear a mandatory relation. though i think this is pre-existing issue as if we have columns which rows which are empty and then the column is updated to mandatory but existing empty rows columns are still as they are.

for point 4 lets fix it for now for this case though.

Reload truncated values after switching multi→single, warn about data
loss, reject empty mandatory relations in UI/API, and block enabling
mandatory when some rows still have no related value.

Signed-off-by: Talha Bin Yousaf <talhayousaf4420@gmail.com>
@he-is-talha

Copy link
Copy Markdown
Contributor Author
  1. Implemented: Multi → single updates without refresh
  2. Warning when turning off multi:
image 3. Mandatory rejects empty image 4. Enabling mandatory with empty rows blocked image

@he-is-talha

Copy link
Copy Markdown
Contributor Author

@samin-z Ready for the review again

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat: add relation column type (multiple)

2 participants