Sign Up
Loading...

Commands in Twidget

Commands are the building blocks of Twidget's no-code platform. They function like code statements and can perform various operations such as creating and updating variables, loops, conditionals, retrieving and manipulating data in the datastore, and much more.

-

Creating a Command

  1. Navigate to the Commands section of your builder.

  2. Click on Add Command. This will open a sidebar.

  3. In the sidebar, you can:

    • Select the command you want to add.

    • Use the search bar to find a specific command.

    • Access your custom functions as commands.

Inputs and Outputs

When you add a command, some commands will require inputs, while others provide outputs that you can use in other commands.

  • To see a comprehensive list of built-in commands and their details, click here.

Managing Commands

Viewing Commands

You can view all your commands and preview their inputs and output variable

Adding Descriptions

For better understanding and managing your business logic, you can add custom descriptions to commands.

Editing Commands

To edit any existing command:

  1. Click on the command you want to edit.

  2. Change its inputs/outputs as needed.

  3. Save your changes.

Get help while editing

When a command has a guide, select the help icon beside its name in the editor header. Its label is View documentation. The guide opens in the documentation panel, keeping your unfinished command changes.

This example shows the help icon beside Has Record, above the command's input and output controls.

Close the documentation panel to continue editing, then save the command when you are ready. Opening a guide does not save or publish your changes.

Deleting Commands

You can delete a command by selecting it and choosing the delete option.

Nested Commands

Some commands allow you to add child commands, for example:

  • Loops: Iterate over a set of items and execute commands for each item.

  • Conditionals: Execute commands based on specified conditions.

Special Commands

  • Return Commands: These commands will halt the execution of the current function, event, or endpoint.

By leveraging these commands, you can create complex workflows and business logic without writing a single line of code.

Related Topics

Workflow templates

Keep reusable workflows in a private library within your workspace. Save a useful endpoint, function, middleware or event, then install independent draft copies when you need the same starting point again. Related workflows are included automatically where supported. Open Workflow templates from 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...

Realtime channels

Send live updates to your app while your customers are signed in. Use a channel for order progress, notifications or a shared activity feed, instead of asking the app to repeatedly check for changes. Realtime messages are temporary notifications. Keep important information in your database so your a...

Inputs

Overview. In Twidget, inputs are essential elements that allow you to configure endpoints and functions. Events do not use inputs. Endpoint Inputs. Endpoint inputs are used to retrieve data from requests. The available types of endpoint inputs are: 1. Path: Variables that are part of the URL path. 2...

Safer Releases

Move a reviewed set of published workflows from a Dev workspace to a Prod workspace. Releases let you review the changes together, keep a release history and review a rollback if you need to restore the previous workflows. Prepare your workspaces. Use two existing workspaces in the same organization...