Orchestration
...
Transform Data
Basic Transformation Options
the table shows advanced transformation options, summary and provides easy to copy/paste examples want to write the code yourself? you can use advanced transformations to write complex jsonata expressions, which gives you significant flexibility to transform data according to your needs see https //docs jsonata org/overview\ html to assist you in writing expressions for the list of context variables, see docid\ ulk0z zxhuatvy90alrw8 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 $valuesfromxml(â\<a/>â) => {âaâ {}} from yaml parse a yaml string example $valuesfromyaml( â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 $valuestoxml({ âaâ {} }) => â\<a/>â to yaml serialize a value to yaml example $valuestoyaml({ â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 $valuestocsv(\[ { âeruidâ âbatmanâ, âdescriptionâ âuses technologyâ }, { âeruidâ âsupermanâ, âdescriptionâ âflies through the airâ } ]) => âeruid,description\nbatman,uses technology\nsuperman,flies through the air\nâ