Filters
- Function filters are useful to perform advanced data manipulation and the syntax is inspired from Jinja Filters (opens in a new tab)
- The filters can be used in Environment Variables and Tests.
- The filter syntax is
{{variable | filter1 | filter2...}}or in Testsjson.items | filter1 | filter2... - If you like to use filters without a variable use @ sign
{{@ | filter1 | filter2}} - The Filters can be used in Headers, Body, Query Params & Tests.
Filters In Env Variable
- This is useful to modify the environment variable value before sending the request
- The filters can be used in Query params, Headers, Auth & Body.

Filters In Tests
- This is useful for advanced use cases to test and set environment variables from the response.

Built-In Filters:
| Function | Description |
|---|---|
| at | The filter will return element at index |
| abs | The filter will return absolute value |
| add | The filter is useful to add number |
| atob | The filter will Base64 decode the value |
| btoa | The filter will Base64 encode the value |
| exec | The filter will execute node command and return value (Paid version required) |
| first | The filter will return first element in array |
| filter | The filter will perform array filter operation |
| format | The format filter useful to format the string output |
| hash | The filter will create hash of the input |
| hmac | The filter will create hash of the input |
| isEmail | The filter will check the input is email or not and return true/false |
| isUrl | The filter will check the input is URL or not and return true/false |
| join | The filter will join array with separator |
| last | The filter will return last element in array |
| length | The filter will return length of the string or array |
| lower | The filter will return lowercase of the string |
| map | The filter will return subset of properties |
| multiply | The filter is useful to multiply numbers |
| parseJSON | The filter will convert string to JSON object |
| prop | The filter will get property value of an object |
| readFile | The filter will read the contents of the file (Paid version required) |
| removeQuotes | The filter will remove quotes from the string |
| removeSpaces | The filter will remove spaces from the string |
| replace | The filter will replace match with replace string |
| setIfValue | The filter will set env variable only when input has value |
| setNull | The filter will set env variable value to null when the property value is null |
| slice | The filter will perform standard array slice operation |
| split | The filter will split the string using the separator |
| stringify | The filter will JSON stringify the object |
| substring | The filter will return substring of the input |
| subtract | The filter will subtract number from input |
| unique | The filter will return unique elements in array |
| upper | The filter will return uppercase of the string |
| urlEncode | The filter will encode the string |
| urlDecode | The filter will decode the string |
at
- The filter will return element at (opens in a new tab) index, The syntax is in Tests
json.items | at(1) - if
json.itemsvalue is[2,6,8,9]thenjson.items | at(1)the result will be6json.items | at(-1)the result will be9
abs
- The syntax is
{{number | abs}} - if
numbervalue is -7, then abs filter will return 7
add
- The syntax is
{{number | add(5)}}or{{number | add("variableName")}} - You can pass parameter value as number or env variable name
- e.g 1: if
numbervalue is 6, then add filter will return 11 - e.g 2: if
numberis 5 andvariableis 8, then result is 13
atob
- The filter will decode (opens in a new tab) the value, The syntax is
{{input | atob}} - if
inputvalue isSGVsbG8gV29ybGQ=, then result isHello World
btoa
- The filter will Base64 encode (opens in a new tab) the value, The syntax is
{{input | btoa}} - if
inputvalue isHello World, then result isSGVsbG8gV29ybGQ=
exec
- The filter will execute node command and return value, The syntax is
{{variable | exec("command")}}or without a variable{{@ | exec("command")}} - You can also pass variables as parameters e.g:
{{@ | exec("gcloud auth {0} {1}", "var1", "var2")}} - if
commandvalue isnode --version, then result isv16.15.0
first
- The filter will return first element in array, The syntax in Tests
json.items | first - if
json.itemsvalue is[3,6,8,9], then result is3
filter
- The filter will perform array filter operation, The syntax in Tests
json.items | filter(id>5) - The following operations are supported
>, >=, <, <=, =, !=, *=, ^=, $= *=filters using contains operation^=filters using startsWith operation$=filters using endsWith operation
format
- The format filter useful to format the string output, The syntax is
{{variable | format("Hello {0}")}} - if
variablevalue isWorld, then result isHello World - Using multiple variables
{{var1 | format("Hello {0} {1} {2}", "var2", "var3")}}, the{0}is replaced withvar1value,{1}withvar2value, and{2}withvar3value. - if you are using in Tests tab to set env value, then you can use e.g
json.var1 | format("hello {0} {1}", "var2")in left input
hash
- The filter will create hash of the input, The syntax is
{{variable | hash("algorithm", "encoding")}}or{{variable | hash}} - @param -
algorithm: The default value isMD5. The values supported areSHA256,SHA512,SHA1,MD5. - @param -
encoding: The default value isbase64. The values supported arehex,base64.
hmac
- The filter will create hash of the input, The syntax is
{{variable | hmac("secret", "algorithm", "encoding")}}or{{variable | hmac("secret")}} - @param -
secret: The name of the env variable where secret is saved. - @param -
algorithm: The default value isSHA256. The values supported areSHA256,SHA512,SHA1,MD5. - @param -
encoding: The default value isbase64. The values supported arehex,base64.
isEmail
- The filter will check the input is email or not return true or false, The syntax in Tests
json.email | isEmail
isUrl
- The filter will check the input is URL or not return true or false, The syntax in Tests
json.homepage | isUrl
join
-
The filter will join array with separator, The syntax is
{{variable | spilit(" ") | join("separator")}}or in Testsjson.items | join -
The default
separatoris comma,so you can usejson.items | join -
if
variablevalue isHello World, then result isHello-World
last
-
The filter will return last element in array, The syntax is
json.items | last -
if
json.itemsvalue is[3,6,8,9], then result is9
length
-
The filter will return length of the
stringorarray, The syntax is{{variable | length}} -
if
variablevalue isHello World, then result is11
lower
-
The filter will return lowercase of the string, The syntax is
{{variable | lower}} -
if
variablevalue isHello World, then result ishello world
map
-
The filter will return subset of properties, The syntax is
{{variable | map("id", "name")}}or In Testsjson.items | map("id") -
e.g 1: In Tests
json.items | map("id")which result in["123","534","56444"] -
e.g 2:
json.items | map("id", "name")which result in[{"name":"test1", "id":"123}, {"name":"test2", "id":"534"}]
multiply
- The syntax is
{{number | multiply(5)}}or{{number | multiply("variableName")}} - e.g 1: if
numbervalue is 6, then multiply filter will return 30 - e.g 2: if
numberis 5 andvariableNameis 8, then result is 40
parseJSON
-
The filter will convert string to JSON object. The syntax is
{{address | parseJSON}} -
The filter can be used with other filters e.g:
{{address | parseJSON | prop("lat")}}
prop
- The filter will get property value of an object, The syntax in Tests
json.items | prop("id") - e.g 1: if
json.itemsvalue is[{"id":1005, "name":"boston"}], thenprop("id")will return1005 - e.g 1: if array is
[{"id":1005, "name":"boston"}, {"id":1006, "name":"london"}], thenprop("id")will return1005,1006
readFile
- The filter will read the contents of the file, The syntax is
{{pathVar | readFile}}or{{pathVar | readFile("base64")}} - Please create a Env variable with value as path of the file. The path can be
absoluteorrelativepath to workspace - Relative path will work only if you enabled the setting
Save To Workspace - e.g 1:
{{pathVar | readFile}}will read the file as text useful to read JSON files. - e.g 2:
{{pathVar | readFile("base64")}}will read the file asbase64encoding useful to read image files. - e.g 3: To use in the request body
{
"data": "{{pathVar | readFile(\"base64\")}}"
}removeQuotes
- The filter will remove quotes from the string, The syntax is
{{variable | removeQuotes}} - if
variablevalue is"Hell"o W'orld, then result isHello World
removeSpaces
-
The filter will remove spaces from the string, The syntax is
{{variable | removeSpaces}} -
if
variablevalue is"Welcome Hello World, then the result isWelcomeHelloWorld
replace
- The filter will replace match with replace string, The syntax is
{{variable | replace("Hello", "NewValue")}} - if
variablevalue isHello World, thenreplace("Hello", "New")result isNew World - You can also pass single argument
{{variable | replace("Hello")}}, which will replace with empty string
setIfValue
- The filter will set env variable only when input has value, The syntax in Tests
json.name | setIfValue - This filter is useful in
Testssection, whenSet Env Variabledropdown selected
setNull
-
The filter will set env variable value to null when the property value is null (by default null value is set as empty). The syntax in Tests
json.name | setNull -
This filter is useful in
Testssection, whenSet Env Variabledropdown selected
slice
-
The filter will perform standard array slice (opens in a new tab) operation, The syntax is
{{variable | split(" ") | slice(1, 2)}} -
if
variablevalue iswelcome to thunder client, then result is["to"]
split
-
The filter will split the string using the separator, The syntax is
{{variable | split("separator")}} -
if
variablevalue isHello World, thensplit(" ")result is["Hello", "World"]
stringify
-
The filter will JSON stringify the object, The syntax is
{{variable | stringify}}
substring
-
The filter will return substring of the input, The syntax is
{{variable | substring(start, end)}} -
if
variablevalue isHello World, thensubstring(-5)result isWorld -
if you like pass
input.length - 5then just pass-5value
subtract
-
The syntax is
{{number | subtract(5)}}or{{number | subtract("variable")}} -
e.g 1: if
numbervalue is 6, then add filter will return 1 -
e.g 2: if
numberis 45 andvariableis 8, then result is 37
unique
-
The filter will return unique elements in array, The syntax is
json.items | unique -
if
json.itemsvalue is[3,8,9,6,8,9], then result is[3,8,9,6]
upper
- The filter will return uppercase of the string, The syntax is
{{variable | upper}} - if
variablevalue isHello World, then result isHELLO WORLD
urlEncode
- The filter will encode (opens in a new tab) the string, The syntax is
{{queryParam1 | urlEncode}} - if
queryParam1value ishello+world, then result ishello%2Bworld
urlDecode
-
The filter will decode (opens in a new tab) the string, The syntax is
{{queryParam1 | urlDecode}} -
if
queryParam1value ishello%2Bworld, then result ishello+world