Basic Transformation Options
123 min
array transformation flatten flatten an array containing potentially nested arrays to a single array example $arrayflatten(\[1, 2, \[3, 4]]) => \[1, 2, 3, 4] pluckby extract the values of a property or deeply nested property of the objects within an array of objects example $arraypluckby(\[{ βcolorβ βbrownβ, βtypeβ βdogβ },{ βcolorβ βbeigeβ, βtypeβ βcatβ }],βtypeβ) => \[βdogβ,βcatβ] sort sort the items of an array of strings or numbers by value example $arraysort(\[3, 4, 1], βdescβ) => \[4, 3, 1] sortby sort the items of an array of objects by the value of a plucked property of the objects within the array example $arraysortby( \[{ βuserβ { βnameβ βfooβ } }, { βuserβ { βnameβ βbarβ } }, { βuserβ { βnameβ βaroundβ } }], βuser nameβ, βascβ ) => \[{ βuserβ { βnameβ βaroundβ } }, { βuserβ { βnameβ βbarβ } }, { βuserβ { βnameβ βfooβ } }] countif count all items of an array that are equal to a specific value example $arraycountif(\[43, 43, 41, 100], 43) => 2 countifby count all items of an array of objects that contain a plucked property equal to a specific value example $arraycountifby( 	\[{ "lastname" "doe" }, { "lastname" "test" }, { "lastname" "doe" }], 	"lastname", 	"doe" ) => 2 sum sum the values of an array of numbers example $arraysum(\[10, 30, 40]) => 80 sumby sum the values of a plucked property of the objects within an array of objects example $arraysumby(\[{ βageβ 10 }, { βageβ 30 }, { βageβ 40 }], βageβ) => 80 avg average the values of an array of numbers example $arrayavg(\[10, 30, 40]) => 26 6666 avgby average the values of a plucked property of the objects within an array of objects example $arrayavgby(\[{ βageβ 10 }, { βageβ 30 }, { βageβ 40 }], βageβ) => 26 6666 min find the minimum value in an array of numbers example $arraymin(10, 30, 40]) => 10 minby find the minimum value of a plucked property of the objects within an array of objects example $arrayminby(\[{ βageβ 10 }, { βageβ 30 }, { βageβ 40 }], βageβ) => 10 max find the maximum value in an array of numbers example $arraymax(\[10, 30, 40]) => 40 maxby find the maximum value of a plucked property of the objects within an array of objects example $arraymaxby(\[{ βageβ 10 }, { βageβ 30 }, { βageβ 40 }], βageβ) => 40 filter filter an array to the values that match a regular expression, a specific value, or non null value example $arrayfilter(\[1, 2, 3, 4, 5, 3], 3) => \[3, 3] filterby filter an array of objects to those that contain a property or deeply nested property whose values match a regular expression, a specific value, or non null value example $arrayfilterby(\[{ βageβ 10 }, { βageβ 30 }, { βageβ 40 }], βageβ, 10) => \[{ βageβ 10 }] numeric transformations round adjust a number rounding or flooring it example $numericround(123 6, 0) => 124 floor adjust a number flooring it example $numericfloor(1234, 1) => 1230 ceil adjust a number ceiling it example $numericceil(1234, 1) => 1240 absolute value compute the absolute value of a number example $numericabs( 1) => 1 less than check if the first number is less than the second example $numericlessthan(2, 7) => true less than or equal check if the first number is less than or equal to the second example $numericlessthanorequal(20, 7) => false greater than check if the first number is greater than the second example $numericgreaterthan(2, 7) => false greater than or equal check if the first number is greater than or equal to the second example $numericgreaterthanorequal(7, 7) => true random generate a random number between inclusive lower and upper bounds example $numericrandombasic(1, 10, βnoβ) => 3 object transformations remove remove a property on an object example $objectremove({ βnameβ βjohnβ }, βnameβ) => {} is equal perform a deep comparison between two values to determine if they are equivalent example $objectisequal({ βageβ 30, βnameβ βjoeβ }, { βageβ 30, βnameβ βjoeβ }) => true has by check if an object contains a property or deeply nested property example $objecthasby({ "key" 1 }, "key") => true pick create an object composed of the picked properties example $objectpick({ βpersonβ { βnameβ βjoeβ }, βageβ 30 }, βageβ) => { βageβ 30 } pluck by extract the value of a property or deeply nested property of an object example $objectpluckby({ βpersonβ { βnameβ βjoeβ }, βageβ 30 }, βperson nameβ) => βjoeβ string transformations strip remove all whitespace (tabs, spaces, and newlines) from both the left and right side of text spaces in between words will not be removed example $stringstrip(β hello word β) => βhello wordβ uuid v4 generate a v4 universally unique identifier (uuid) example $stringuuidv4() => βbe407787 14e1 47d1 9b25 9eaa624f7a5fβ hash compute that hash of a value example $stringhash(βdataβ, βmd5β) => β8d777f385d3dfec8815d20f7496026dcβ pad pad a string on the left and right sides if it's shorter than length padding characters are truncated if they can't be evenly divided by length example $stringpad("abc", 8) => β abc β pad start pad a string on the left side if it's shorter than length padding characters are truncated if they can't be evenly divided by length example $stringpadstart(βabcβ, 5,βhβ) => βhhabcβ pad end pad a string on the right side if it's shorter than length padding characters are truncated if they can't be evenly divided by length example $stringpadend("abc", 5,"h") => "abchh" repeat repeat a string n times example $stringrepeat(βabcβ, 2) => βabcabcβ camel case convert a string to camel case example $stringcamelcase(βhello worldβ) => βhelloworldβ capitalize convert the first character of a string to upper case and the remaining to lower case example $stringcapitalize("hello world") => "hello world" starts with check if a string starts with another example $stringstartswith(βabcβ, βaβ) => true ends with check if a string ends with another example $stringendswith(βabcβ, βcβ) => true eval expression parse and evaluate a string containing literal json or a jsonata expression example $stringevalexpression(β\[1,$string(number),3]β, { βnumberβ 2 }) => \[1,β2β, 3] value transformations is array check if value is an array example $valueisarray(\[1, 4, 4]) => true is string check if value is a string example $valueisstring(βdataβ) => true is null or undefined check if value is null or undefined example $valueisnullorundefined(null) => true is object check if a value is an object example $valueisobject({}) => true from xml parse an xml string example $valuefromxml(β\<a/>β) => {βaβ {}} from yaml parse a yaml string example $valuefromyaml( βversion 1 0 0\ndependencies \n yaml ^1 10 0\npackage \n exclude \n idea/ \n gitignore\nβ ) => { βversionβ β1 0 0β, βdependenciesβ { βyamlβ β^1 10 0β}, βpackageβ {βexcludeβ \[β idea/ β, β gitignoreβ]}} from csv parse a csv string example $valuefromcsv(βeruid,description\nbatman,uses technology\nsuperman,flies through the airβ) => \[ { βdescriptionβ βuses technologyβ, βeruidβ βbatmanβ }, { βdescriptionβ βflies through the air', βeruidβ βsupermanβ } ] to xml serialize a value to xml example $valuetoxml({ βaβ {} }) => β\<a/>β to yaml serialize a value to yaml example $valuetoyaml({ βversionβ β1 0 0β, βdependenciesβ { βyamlβ β^1 10 0β }, βpackageβ { βexcludeβ \[β idea/ β, β gitignoreβ] } }) => βversion 1 0 0\ndependencies \n yaml ^1 10 0\npackage \n exclude \n idea/ \n gitignore\nβ to csv serialize a value to csv example $valuetocsv(\[ { βeruidβ βbatmanβ, βdescriptionβ βuses technologyβ }, { βeruidβ βsupermanβ, βdescriptionβ βflies through the airβ } ]) => βeruid,description\nbatman,uses technology\nsuperman,flies through the air\nβ