Skip to main content
Version: 1.28 (Current)

Output

Audience: Low-code Engineers

Skill Prerequisites: Actions, Tokens, APIs

The Output actions return the response of an API endpoint. They send back text, HTML, XML, JSON or a file, and some let you set the HTTP status code and headers.

Each of them is a final action. It ends the API method, so actions after it don't run. If no action returns a response, the API returns the text Success.

Choosing an action​

ActionWhat it doesUse it to
Raw ResponseReturns content you write yourself, with your own status code and headers. Tokens aren't escaped.Return a custom JSON or XML body, plain text, or a custom error from the API's On error actions.
New Object as JSONReturns a flat JSON object built from name/value pairs. Values are escaped.Return a simple result, such as a new ID, or an error object with a 400 status.
Existing Object as JSONReturns the first matching entry of a list as a JSON object.Return a single record, such as the customer with a given ID.
Existing List as JSONReturns the entries of a list as a JSON array, optionally only the ones that match criteria.Return the rows of a query from a GET endpoint.
Download FileReturns a file by ID or path, with a file name, folder permission checks and a download or preview option.Give users a secure download link for an invoice or a generated report.
File ResponseReturns a portal file by its ID through the site's normal file handling. It can be cached.Serve a report or feed from a fixed API URL, and cache it until the file changes.

JSON responses​

  • Flat, and every value is a string. New Object as JSON, Existing Object as JSON and Existing List as JSON write every value as a JSON string, even numbers, booleans and dates. They don't write nested objects or arrays.
  • Nested or typed JSON. Build it with Create JSON Object or List to JSON, then return it with Raw Response and a Content-Type header of application/json.
  • Escaping. New Object as JSON and Existing List as JSON escape quotes and special characters, so the response is valid JSON. Raw Response inserts token values as they are, so a quote in a value can break the JSON.
  • Existing Object as JSON reads a list. Despite its name, it doesn't read objects made with Create Object.
  • Missing lists. If the list doesn't exist, the two Existing actions return null with status 200, whatever Http code says.

Files​

  • Download File checks that the caller can view the file's folder, unless you turn on an override. It accepts a file ID or a path, lets you rename the file and chooses between download and preview. Its response is never cached.
  • File Response only accepts a file ID. It doesn't check folder permissions itself or limit the file to the current portal. When the API has Cache Response on, the response is cached until the file, a file dependency or a cache key changes.
  • Validate file IDs from the request. If the ID comes from the caller, check that they may have the file, for example with a Run SQL Query and a condition.

To send a file from a form or listing instead of an API, use Send File for Download.

Status codes and choosing a response​

  • Http code. Raw Response and the three JSON actions let you set the status code. It must start with a number, for example 201 or 404 Not Found, or the API returns an error. If it's empty, the status is 200.
  • Only the first final action that runs returns the response. Put conditions on the actions to choose between responses, for example a 404 when a record isn't found and a 200 otherwise.
  • Cached responses don't depend on the caller. With Cache Response on, Raw Response and File Response are cached for the same input values and returned to whoever calls. Don't cache an API that returns different data per user unless the user is one of the inputs.

To build lists for these actions, see Lists Objects. To build JSON in a token, see Parsing.

Revised 10/02/2026