ROOM64 / KNOWLEDGE / NOCODB

Fields: Virtual & Formula

Add calculated or derivative data with virtual fields in NocoDB.

อ่านต้นฉบับที่ NocoDB Official Docs ↗
เอกสารอ้างอิงภาษาอังกฤษเนื้อหาจากเอกสาร NocoDB คงรายละเอียดและโค้ดตามต้นฉบับ · ต้นฉบับอัปเดต 2026-08-17 ชื่อเมนูและฟีเจอร์ที่ใช้ได้ขึ้นอยู่กับเวอร์ชันและรุ่นที่ทีมใช้งาน

Workflows · ระบบอัตโนมัติและ Scripts · Fields: Virtual & Formula

← Generic Examples

สารบัญในหน้านี้

Add calculated or derivative data with virtual fields in NocoDB.

This script demonstrates how to create and work with the following virtual fields in NocoDB: Barcode, Formula

For detailed descriptions of each field type and associated configuration options, refer to the NocoDB meta API documentation .

// NocoDB Script: Create Virtual & Formula Fields

const tableName = 'Virtual Fields Demo';
let table = base.getTable(tableName);

if (!table) {
  table = await base.createTableAsync(tableName, []);
  output.text(`✅ Created table: "${tableName}"`);
}

// helper
async function createField(name, config) {
  if (!table.getField(name)) {
    await table.createFieldAsync({ name, ...config });
    output.text(`✅ Created: ${name}`);
  }
}

// Base text field required for virtual examples
await createField('Name', { type: "SingleLineText" });

// Create Barcode linked to “Name”
const nameField = table.getField('Name');
await createField('Barcode', {
  type: "Barcode",
  options: { barcode_value_field_id: nameField.id }
});

// Formula combining text
await createField('Greeting', {
  type: "Formula",
  options: { formula: 'CONCAT("Hello, ", {Name}, "!")' }
});

output.table(table.fields.map(f => ({ 'Field Name': f.name, 'Type': f.type })));
output.text(`ℹ️ Total fields created: ${table.fields.length}`);

  • Table Operations : Demonstrates how to check for table existence, create a table, and list all tables in the base.
  • Fields: Text-Based : Learn how to create and manage text-based fields in NocoDB.
  • Fields: Numerical : Learn how to create numerical fields for storing quantities, percentages, currency, and more.
  • Fields: Date & Time : Create fields to capture dates, times, and durations.
  • Fields: Select : Create single select and multi select fields for categorizing data.
  • Fields: System : Capture automatic audit information with system fields in NocoDB.
  • Fields: User & Collaborator : Assign or reference users directly within records.
  • Fields: Miscellaneous : Additional field types for attachments, checkboxes, ratings, and structured data.
เนื้อหาเอกสารอ้างอิงและภาพประกอบมาจาก NocoDB Official Docs · บทความแนะนำภาษาไทยเรียบเรียงโดย Room64 · เว็บไซต์นี้เป็นคู่มือประกอบการใช้งานโดย Room64 · เอกสารทางการ ↗

มีงานที่อยากให้ Software, AI หรือ Automation ช่วยอยู่ไหม?

เล่า workflow หรือปัญหาที่ทีมกำลังเจอ เราช่วยดูได้ว่าควรใช้ระบบสำเร็จรูป เชื่อมเครื่องมือเดิม หรือพัฒนาเพิ่มเฉพาะส่วนไหน

คุยกับเราทาง LINEhello@room64.net