Sign Up
Loading...

Data Types

Twidget supports six main data types to facilitate interactions within the platform. These data types are essential for defining inputs, outputs, and table fields, helping users understand the nature of the data being handled. The available data types in Twidget are as follows:

Text

  • Description: Represents any string of characters.

  • Usage: Used for fields or inputs that require text, such as names, descriptions, emails, etc.

  • Example: "Hello, World!"

Number

  • Description: Represents both integer and floating-point numbers.

  • Usage: Used for fields or inputs that require numerical values, such as age, price, score, etc.

  • Example: 42, 3.14

Boolean

  • Description: Represents a binary value (true or false).

  • Usage: Used for fields or inputs that require a true/false value, such as yes/no questions, toggles, etc.

  • Example: true, false

Date

  • Description: Represents dates and times.

  • Usage: Used for fields or inputs that require date and/or time values, such as birthdates, appointment times, etc.

  • Example: "2023-10-05T14:48:00.000Z"

Object

  • Description: Represents a collection of key-value pairs.

  • Usage: Used for fields or inputs that require structured data, such as JSON objects.

  • Example: { "name": "John Doe", "age": 30 }

File

  • Description: Represents file data.

  • Usage: Used for fields or inputs that require file uploads, such as documents, images, etc.

  • Example: {"filename": "document.pdf", "size": 1024}

Applications of Data Types

Data types in Twidget are used to:

  • Define Inputs: Specify what type of data can be entered into form fields.

  • Specify Outputs: Indicate what type of data will be generated or returned by a function or process.

  • Create Table Fields: Determine the types of data that can be stored in each column of a table, ensuring data integrity and appropriate handling.

Related Topics

Output

Each function also has an optional output where you can return an output variable. To simplify the use of functions, you can define an output schema. The output schema acts as an internal documentation detailing what the output of the function will look like. This makes it easier to understand and u...

Working on smaller screens

Twidget adapts its navigation, lists and editing panels to phones, tablets and smaller laptop windows. You can use the same workspace and saved workflows across these views. Open your workspace tools. On a phone, use the menu button at the top to open workspace navigation. Choose a tool from Build, ...

Reusable Middleware

Middleware is a reusable workflow that runs before or after an endpoint, function or event. Build it once, then apply it wherever you need the same input checks, response formatting or logging. Create middleware. Open Middleware from the sidebar and choose Create Middleware. Give it a clear name, su...

Command Output

Some commands in Twidget return outputs, which are essential for dynamic and conditional logic within your workflows. These outputs are displayed next to the command and are prefixed with an "as" to indicate the variable name. Using Output Variables. Once a command returns an output, you can use the...

Globals & secrets

Keep shared configuration and private values in one place. Open Global at the top of an endpoint, function or event, or open the manager from Settings. The Variables and Secrets tabs belong to the selected workspace. Use ordinary variables for reusable settings such as a default page size or service...