DataJet
Search…
Welcome to DataJet
Tasks
Introduction
Blank
OOTB
Creating a custom task
Hooks
Introduction
Liquid
Introduction
Tags
Filters
apply
base64_decode
base64_encode
concat
encodeURI
email
file
graphql
http
in_timezone
log
parse
push
rest
time_subtract
time_add
run
Misc
Functions
Variables
Examples
Processing user submitted forms
Create orders from csv file
Custom shipping rates
Create simple order report
Send order data to Zapier
Powered By
GitBook
apply
apply
is used to call a
function
. The argument before the pipe becomes function_input, and argument after colon is function name.
Example
Let's assume we have simple function called
hello_world
defined with below code.
1
{
%
assign input
=
function_input
%
}
2
{
%
assign input
[
"foo"
]
=
"bar"
%
}
3
{
%
global function_output
=
input
%
}
Copied!
Now, you can call this function in hooks code using
apply
filter:
1
{
%
assign fn_input
=
'{"foo": ""}'
|
parse
%
}
2
{
%
assign fn_result
=
fn_input
|
apply
:
"hello_world"
%
}
Copied!
As a result, value of fn_result will be:
1
{
2
"foo": "bar"
3
}
Copied!
Liquid - Previous
Filters
Next
base64_decode
Last modified
1yr ago
Copy link
Contents