Sign Up

On this page

Return

The return command in Twidget is a special command used to halt the current command workflow and immediately return a specified result. This command overrides any subsequent processes and outputs the return result regardless of the rest of the workflow logic. This command is particularly useful for error handling, conditional exits, or when a certain result needs to be promptly returned.

Parameters

  • <result>: The value or object you want to return. This result can be a simple data type (e.g., text, number, boolean) or a complex object.

Usage

When the return command is executed, it:

  1. Stops the execution of the current workflow.

  2. Discards any further processing or commands that follow it in the workflow.

  3. Outputs the specified result as the final output of the workflow.

It is imperative to consider how the return command fits into your overall output schema since it will determine the structure and type of the final output.

Considerations

  • Output Schema: Ensure the output schema of your workflow accounts for the type of results that might be returned by the return command.

  • Workflow Design: Carefully design your workflows to use the return command appropriately for intended early exits or error handling mechanisms.

  • Command Placement: Place the return command where specific conditions are met to avoid unintended workflow terminations.

The return command is powerful for controlling the flow and output of workflows in Twidget. By understanding its behavior and correctly implementing it in your workflows, you can create more efficient and effective automation processes.

Related Topics

Send External HTTP Request

Using Twidget, you can send external HTTP requests effortlessly. This functionality allows you to communicate with external servers or APIs. Below, you will find the necessary parameters and structure to set up an HTTP request. Parameters. - URL: The endpoint to which the request will be sent. - Met...

Send Message

Send SMS Command. With Twidget, you can send SMS messages to phones using the `Send SMS` command. This functionality varies depending on the provider. Currently, we support Twilio as the SMS provider. To use Twilio for SMS integrations, you will need: - A Twilio account ID - Twilio Auth Token - A Tw...

Managing Files

Twidget offers a set of commands to manipulate files in your file store. Below are the descriptions and usage of each command to help you understand how to utilize them effectively. Get File. Retrieve a file via file path. Inputs: - `path`: The file path to retrieve the file from. Outputs: - `filena...

Conversion

Overview. Twidget's conversion commands allow you to easily convert different data types to the required format. Below is a list of the available conversion commands and examples of how to use them. The `Convert to Text` command converts the provided value to a text (string) format. Examples: - `123...

Variables

Variables are essential building blocks in Twidget that allow you to store and manipulate data dynamically within your no-code applications. They enable you to create flexible and interactive applications by holding values that can be changed and referenced throughout your workflow. Creating Variabl...