What is numeric() prefix
The numeric() prefix is an advanced built-in function that is used to convert a value mapped inside it into a numerical format. This prefix is commonly used in request JSON when certain values such as age and zip code need to be converted to numerical format.
For instance, consider the following example:
JSON:
{
"name": "John",
"age": "numeric({{age}})",
"address": {
"street": "123 Main St",
"city": "Anytown",
"zipcode": "numeric({{zipcode}})"
}
}
In this JSON, the age and zip code are enclosed in the numeric() prefix to convert them to numerical format.
When a user fills in the age and zip code values in the workflow page or maps them from a previous step, the values are returned in numerical format, as shown below:
JSON:
{
"name": "",
"age": 23,
"address": {
"street": "ferwr"
"zipcode": 462016
}
}
Using the numeric() prefix can ensure that certain values are always returned in numerical format.
How to Use nemric() prefix:
In the given example API endpoint requires the value of age and zipcode in number format. So I'll map age and zipcode inside numeric() prefix like this -
In the workflow page when the user will fill age and zip code value or map from previous step -
I'll get age and zipcode in the number format like this -
Last edited by a moderator: