Portal Community

The AI Form Generation Workflow

Once you have a Data Ocean SQL table, creating the corresponding data entry form traditionally requires manually designing field layouts, writing validation rules, and wiring up SQL binding — a repetitive, time-consuming process. The AI Form Generator eliminates this by taking your SQL schema as input and producing a complete AtlasForms form definition as output.

1

Provide the SQL Schema

Give the AI your CREATE TABLE statement or a description of the table's columns. The AI analyzes column names, types, constraints, and nullability to understand the data shape.

2

AI Generates the Form Definition

The AI produces an AtlasForms form JSON definition with field controls, labels, validation rules, required flags, and field ordering — all inferred from the schema. It also generates the corresponding SQL INSERT/UPDATE commands with parameter bindings.

3

Review and Customize

Import the generated form into the AtlasForms Studio designer. Review the field layout, adjust labels, add any business-specific validation rules, and customize the visual design.

4

Attach CRUD Workflows

Wire the form's submit action to a Flow Studio workflow that contains the SqlUpdateNode generated by the AI. The form is now a fully functional data entry interface backed by your Data Ocean SQL table.

How to Trigger AI Form Generation

From AtlasForms Studio

In the AtlasForms Studio, click New Form → Generate with AI and select From SQL Schema. Paste your CREATE TABLE statement in the input box. The AI generates and previews the form before you save it.

From the API

// POST /api/forms/generate
{
  "generationType": "SqlSchema",
  "tenantId": 42,
  "sqlSchema": "CREATE TABLE Customer (\n  CustomerId uniqueidentifier NOT NULL,\n  TenantId int NOT NULL,\n  Name nvarchar(300) NOT NULL,\n  Email nvarchar(300) NOT NULL,\n  Phone nvarchar(50) NULL,\n  Industry nvarchar(200) NULL,\n  Status nvarchar(50) NOT NULL DEFAULT 'Active',\n  CreatedAt datetime2 NOT NULL,\n  UpdatedAt datetime2 NOT NULL,\n  IsDeleted bit NOT NULL DEFAULT 0\n)",
  "formOptions": {
    "excludeColumns": ["TenantId", "CreatedAt", "UpdatedAt", "IsDeleted", "DeletedAt"],
    "primaryKeyColumn": "CustomerId",
    "generateSqlCommands": true,
    "datasourceId": "customer-data-db"
  }
}

What the AI Generates

For the Customer table example, the AI generates:

Field Mappings

ColumnSQL TypeForm ControlValidation
Namenvarchar(300) NOT NULLText InputRequired, MaxLength: 300
Emailnvarchar(300) NOT NULLEmail InputRequired, Email format, MaxLength: 300
Phonenvarchar(50) NULLPhone InputOptional, Phone format, MaxLength: 50
Industrynvarchar(200) NULLText Input or DropdownOptional, MaxLength: 200
Statusnvarchar(50) NOT NULL DEFAULT 'Active'Dropdown (Active, Inactive)Required, Default: Active

Generated SQL Commands

-- INSERT command for form submit
INSERT INTO Customer
    (CustomerId, TenantId, Name, Email, Phone, Industry, Status, CreatedBy, CreatedAt, UpdatedAt)
VALUES
    (NEWID(), @tenantId, @name, @email, @phone, @industry, @status, @createdBy, GETUTCDATE(), GETUTCDATE())

-- UPDATE command for form edit submit
UPDATE Customer SET
    Name = @name,
    Email = @email,
    Phone = @phone,
    Industry = @industry,
    Status = @status,
    UpdatedAt = GETUTCDATE()
WHERE TenantId = @tenantId
  AND CustomerId = @customerId
  AND IsDeleted = 0
Excluded Columns

The excludeColumns option prevents system-managed columns (TenantId, CreatedAt, UpdatedAt, IsDeleted) from appearing in the form as user-editable fields. The AI generates the SQL commands with these columns hardcoded to their system-managed values.

Customizing the Generated Form

After importing the generated form into AtlasForms Studio, common customizations include: