> For the complete documentation index, see [llms.txt](https://docs.flowstem.app/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.flowstem.app/commands/advanced-utilities.md).

# Advanced utilities

Advanced utilities create and transform values, communicate with external APIs, and run custom logic.

## Set Variable

Saves text or a value for later commands.

* **Configure:** Value and output variable.
* **Output:** The value under a name beginning with `$`.
* **Example:** Save `https://example.com` as `$base_url`.

## Parse JSON

Reads JSON text and optionally extracts a nested property.

* **Configure:** JSON source, optional property path, and output variable.
* **Output:** The parsed value or selected property.
* **Example:** Read `$api_response` and extract `customer.email` into `$email`.

Leave the property path empty to store the complete parsed value.

## Transform Text

Changes text and stores the result in a new variable.

* **Configure:** Input, operation, operation-specific values, and output variable.
* **Operations:** Trim, uppercase, lowercase, replace text, or replace using a regular expression.
* **Example:** Trim `$name` and store the result in `$clean_name`.

## Transform Date

Converts a date from one supported format to another.

* **Configure:** Input value, input format, output format, and output variable.
* **Input formats:** Automatic detection, common date formats, ISO 8601, and Unix timestamps.
* **Output:** A formatted date string or Unix timestamp.
* **Example:** Convert `09/16/2026` to `2026-09-16`.

## Date & Time

Stores the current date, time, or both.

* **Configure:** Date/time mode, format, local or UTC timezone, and output variable.
* **Output:** A formatted current value.
* **Example:** Store today's local date in `$today` for a Date & Time Field command.

## Screenshot

Captures the current page viewport or the full page.

* **Configure:** Viewport or full-page mode, destination, optional file name, and output variable.
* **Destinations:** Save locally or upload to the connected Google Drive account.
* **Output:** The local saved path or Google Drive link.
* **Example:** Save a full-page confirmation screenshot to `$screenshot_path`.

## Generate Value

Creates a reusable value without reading it from the page.

* **Configure:** Generation mode and output variable.
* **Modes:** UUID, random number within a range, timestamp, or random item from a list.
* **Example:** Generate a UUID and save it as `$reference_id`.

## JavaScript

Runs custom JavaScript in the current page.

* **Configure:** JavaScript code.
* **Variables:** Flowstem variables can be used by the command according to the editor's variable insertion controls.
* **Use it for:** Page behavior that cannot be represented by another Flowstem command.
* **Example:** Read a value exposed by the page's own JavaScript application.

{% hint style="warning" %}
JavaScript is powerful and runs in the selected website. Use code you understand, avoid entering secrets, and prefer built-in commands when they can do the same job.
{% endhint %}

## Make HTTP Request

Sends an HTTP request or webhook and saves selected parts of the response.

* **Configure:** URL, method, query parameters, headers, body type, body, timeout, and output variables.
* **Methods:** GET, POST, PUT, and PATCH.
* **Body types:** None, JSON, form fields, or raw text.
* **Outputs:** Complete response, status, response text, parsed JSON, and response headers can be assigned to separate variables.
* **Example:** POST a JSON object, save the status to `$http_status`, and save parsed JSON to `$response_json`.

Do not place permanent secret tokens directly in workflows that will be exported or shared.

## AI

Sends instructions and a prompt to a configured AI provider and stores its response.

* **Configure:** Provider, model, instructions, prompt, response format, optional schema, and output variable.
* **Providers:** OpenAI, Anthropic, and Google Gemini when configured in Flowstem settings.
* **Response formats:** Plain text or structured output based on an example or JSON Schema.
* **Example:** Ask the model to classify `$page_text` and save structured results to `$classification`.

The API request is sent directly to the selected provider using the key stored locally in Flowstem. Provider charges and limits apply separately from your Flowstem plan.
