Convert Type Block
Convert Type reads one variable, converts it to text, number, boolean, date, list, or object, and saves the result under a new variable name.
At a glance
What it does
Convert Type changes one variable into another data type and saves it to an output variable.
Optional strategies handle strict or permissive numbers, currency and number extraction, common or custom boolean values, and common date formats.
Use it when
- Convert scraped numeric text before Calculate.
- Turn simple values into text for templating.
- Parse JSON text into a list or object.
- Normalize booleans or dates before branching.
Do not use it when
- You need formatting operations; use Format.
- You need to reshape every item in a list; use Loop or Format.
- The input is ambiguous and no conversion strategy describes it.
Settings
Convert Type needs a source variable, target type, and output variable. Strategy and error handling are optional.
Source variable
Required: Yes- Variables
- Variable name
- Description
- Variable to convert.
Target type
Required: Yes- Variables
- No
- Description
- Configured type to convert into.
Conversion strategy
Required: No- Variables
- No
- Description
- Optional target-specific parsing behavior, such as strict, currency, extract, ISO, US, EU, or custom boolean values.
On conversion error
Required: No- Variables
- No
- Description
- Fail the Block, return the target type default, or keep the original value. The default behavior returns the target type default.
Output variable
Required: Yes- Variables
- Variable name
- Description
- Variable that receives the converted value.
Outputs
Convert Type writes the converted value to the output variable.
{{outputVariableName}}string | number | boolean | unknown[] | objectConverted value. The exact type depends on the selected target.
Example Flow
Use Convert Type before Calculate or Conditional when the next Block expects a specific type.
- Extract or read a value.
- Convert it to the needed type.
- Use the converted output variable later.
Errors and fixes
Start with symptoms visible in the editor or Inspector, then check the earliest Block that produced the wrong page state, variable, or output.
The converted value is the target type default.
- Check
- Check the selected conversion strategy and error handling.
- Fix
- Choose a strategy that matches the input, or select Fail to expose invalid values.
A number conversion fails.
- Check
- Check whether the input contains currency symbols, commas, or extra text.
- Fix
- Use Currency or Extract strategy, or clean the value with Format first.
Local and cloud runs
Local runs, Cloud Runs, and exported TypeScript share the same target types, conversion strategies, defaults, and error-handling behavior.