Skip to content

#1840: API structure improvement: expose columns through a technical name/slug/alias#2428

Open
samin-z wants to merge 5 commits intomainfrom
feature/1840-expose-columns
Open

#1840: API structure improvement: expose columns through a technical name/slug/alias#2428
samin-z wants to merge 5 commits intomainfrom
feature/1840-expose-columns

Conversation

@samin-z
Copy link
Copy Markdown
Contributor

@samin-z samin-z commented Mar 30, 2026

Feature ticket: #1840

New response structure:

"data": [
{
"columnId": 70,
"value": 11
},
{
"columnId": 72,
"value": 3
},
{
"columnId": 76,
"value": [
{
"id": "user1",
"type": 0,
"displayName": "user1"
}
]
}
],
"dataByAlias": {
"column_70": {
"columnId": 70,
"value": 11
},
"column_72": {
"columnId": 72,
"value": 3
},
"test_customer": {
"columnId": 76,
"value": [
{
"id": "user1",
"type": 0,
"displayName": "user1"
}
]
}
}

now we have new field added to columns called 'technical_name' which if user does not add it as default will be 'column_{id}', 'dataByAlias' added on top of 'data' not to break the current structure.
Screenshot 2026-03-30 at 15 13 32

@blizzz blizzz added enhancement New feature or request 3. to review Waiting for reviews labels Apr 2, 2026
samin-z added 3 commits April 7, 2026 11:19
Signed-off-by: samin-z <samin.zavarkesh@gmail.com>
Signed-off-by: samin-z <samin.zavarkesh@gmail.com>
Signed-off-by: samin-z <samin.zavarkesh@gmail.com>
@samin-z samin-z force-pushed the feature/1840-expose-columns branch from 8607112 to 5e0e8bc Compare April 7, 2026 09:19
Signed-off-by: samin-z <samin.zavarkesh@gmail.com>
@samin-z samin-z marked this pull request as ready for review April 10, 2026 15:30
@samin-z samin-z requested review from blizzz and enjeck as code owners April 10, 2026 15:30
Copy link
Copy Markdown
Contributor

@enjeck enjeck left a comment

Choose a reason for hiding this comment

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

some comments

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.

Looking at #1840, in order for this to be useful for workflows, we must expose it via AbstractRowEvent.php -> toPublicRow() ?

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.

I believe we're now doing 2 writes? Both create() and importColumn() create a column first and only then assign the fallback column_ name. If the second write fails, the request throws after the insert has already succeeded, so we leave behind a persisted column without the technicalName. Maybe we should have a transaction then?

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.

there is no problem even if the update of technicalName fails a 'null' value for the column is valid. When 'technicalName' is null, the code in RowService handles it:
$alias = $aliasByColumnId[$columnId] ?? ('column_' . $columnId);
this causes the column to behave correctly with the 'column_{columnId}' fallback.
also when the user edits and saves the column, the 'null' will be updated with either their chosen value or the default 'column_{columnId}'.

Comment on lines +230 to +241
normalizeTechnicalName(technicalName) {
const normalized = technicalName?.trim()
return normalized === '' ? null : normalized
},
isTechnicalNameValid() {
const technicalName = this.normalizeTechnicalName(this.editColumn.technicalName)
if (technicalName === null) {
return false
}

return /^[a-z][a-z0-9_]*$/.test(technicalName)
},
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.

used here and in CreateColumn, could be moved to a shared file and reused

Comment thread src/modules/modals/EditColumn.vue Outdated
Comment on lines +236 to +238
if (technicalName === null) {
return false
}
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.

we return false for null technicalName when we edit but true for creating? Why?

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.

that wa my mistake as i was going through it and forgot to update

Signed-off-by: samin-z <samin.zavarkesh@gmail.com>
@samin-z samin-z requested a review from enjeck April 13, 2026 14:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

3. to review Waiting for reviews enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants