Fluent Table API - autoNumber does not work
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago - last edited 3 weeks ago
Hello Community!
I have created a table using Fluent's Table API, and the table is created correctly, as well as the "title" column, but it seems to ignore the autoNumber. After reading the documentation, I can’t find what might be happening, so I wanted to ask if anyone else is experiencing the same issue.
import { StringColumn, Table } from "@servicenow/sdk/core";
export const x_680259_da_demo = Table({
name: "x_680259_da_demo",
label: "Demo",
autoNumber: {
prefix: "DEMO",
},
schema: {
title: StringColumn({
label: "Title",
mandatory: true,
}),
},
});
In the logs for the build and deploy commands, everything seems correct — no errors are shown.
~/Git/pdi $ npm run build
> demo-app@0.0.1 build
> now-sdk build
[now-sdk] Initiating the build process ...
[now-sdk] Building project from /Users/***/Git/pdi...
[now-sdk] Type check completed successfully
[now-sdk] Running script "prebuild" from /Users/***/Git/pdi/now.prebuild.mjs
[now-sdk] Bundled chunk: main.jsdbx (134736 bytes)
[now-sdk] Bundled asset: main.jsdbx.map (1082054 bytes)
[now-sdk] Bundled asset: index.html (423 bytes)
[now-sdk] Script "prebuild" completed successfully
[now-sdk] Build completed successfully
~/Git/pdi $ npm run deploy
> demo-app@0.0.1 deploy
> now-sdk install
[now-sdk] Starting installation...
[now-sdk] Attempting to log into instance https://dev******.service-now.com/ as admin.
[now-sdk] Installation completed. Access the application at: https://dev******.service-now.com/sys_app.do?sys_id=********************************
~/Git/pdi $ node -v
v25.8.2
~/Git/pdi $ npm -v
11.12.0
This is my package configuration
{
"name": "demo-app",
"version": "0.0.1",
"description": "",
"license": "UNLICENSED",
"imports": {
"#now:*": "./@types/servicenow/fluent/*/index.js"
},
"scripts": {
"build": "now-sdk build",
"deploy": "now-sdk install",
"transform": "now-sdk transform",
"types": "now-sdk dependencies",
"dev": "now-sdk run dev"
},
"devDependencies": {
"@servicenow/sdk": "4.4.1",
"@servicenow/glide": "27.0.4",
"eslint": "8.50.0",
"@servicenow/eslint-plugin-sdk-app-plugin": "4.4.1",
"@servicenow/isomorphic-rollup": "^1.2.14",
"rollup-plugin-vue": "6.0.0",
"typescript": "5.5.4"
},
"dependencies": {
"vue": "3.5.21"
}
}
Build tag: glide-zurich-07-01-2025__patch6-01-16-2026
Thanks in advance!!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
Hi Alex,
Yeah, this one is a bit confusing — you’re not doing anything wrong syntactically.
What’s actually happening
The autoNumber property in the Fluent Table API does not always provision the underlying number field/logic the same way as traditional tables. In some builds (including Zurich patches), it creates the table but doesn’t fully wire up the auto-numbering behavior.
So:
- Table gets created
- Column schema works
- Auto number → silently not applied
What to check first
- Go to System Definition → Tables
- Open your table
- Check if:
- A
numberfield exists - Dictionary entry has Auto-number = true
- A
Most likely → it’s missing or not configured
Workaround (recommended)
Option 1: Manually configure auto-number
After deployment:
- Create a field:
- Name:
number - Type: String
- Name:
- Set:
- Auto-number = true
- Prefix = DEMO
- Configure Number Maintenance if needed
Option 2: Use Number Maintenance directly
Go to:
- System Definition → Number Maintenance
Create an entry for your table:
- Table: your custom table
- Prefix: DEMO
- Number of digits, etc.
Option 3: Scripted fallback (if needed)
As a fallback, you can generate numbers via Business Rule:
- Before insert
- Populate
numberusing a sequence
(Not ideal, but works if auto-number is unreliable)
Important note
Fluent SDK is still evolving, and some table-level features like auto-numbering are:
- Either partially implemented
- Or require manual post-deploy configuration
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
I understand from your message that this is a bug in Fluent, because what’s the point of having the autoNumber parameter if it doesn’t behave as expected (and it’s even in the documentation)? Do you know if there’s a known issue open for this?
The workaround is basically to go to the instance and create the auto-number from the table record, like we’ve always done..
Thanks for your reply!
