Tutorial part 3: Define a table in ServiceNow Fluent code
Create a table and reference it in sample script definitions using the ServiceNow Fluent APIs.
始める前に
Complete Tutorial part 2: Initialize a repository for your application.
Role required: admin
このタスクについて
ServiceNow Fluent is a domain-specific language (DSL) based on TypeScript for defining the metadata files [sys_metadata] that make up applications and includes APIs for the different types of metadata, such as tables, roles, ACLs, business rules, and Automated Test Framework tests. You use objects in the ServiceNow Fluent APIs to define metadata in files with the .now.ts extension. The ServiceNow IDE has language processing and validation for ServiceNow Fluent APIs and applications by default. For more information about ServiceNow Fluent, see ServiceNow Fluent.
In this example, you create a simple table for a to-do list using objects in the ServiceNow Fluent Table API. Then, you update the sample code for business rule and client script definitions to reference the new table. Lastly, you review your changes from the File Categories view. For more information about the Table API, see Table API - ServiceNow Fluent.
手順
タスクの結果
You have created your first application metadata using ServiceNow Fluent APIs. The To-do Items [x_snc_hello_world_to_do] table can be modified in source code by other ServiceNow IDE users or from other ServiceNow AI Platform user interfaces.
From the ServiceNow AI Platform, you can navigate to the list view of the table by entering x_snc_hello_world_to_do.list in the navigation filter. Because you updated the client script definition to run on the To-do Items [x_snc_hello_world_to_do] table, if you select New to add a record to the table, the message from the client script appears when the record loads.
次のタスク
Continue to Tutorial part 4: Install and use a third-party library.