Explore more
Functions

General functions

10min
general functions let you fine tune your mapping in a {{scenario singular lowercase}} for example, you can select or leave out items in an array or apply conditional criteria to your mapping below is a list of general functions you can use get get (object or array; path) returns the value path of an object or array to access nested objects, use dot notation the first item in an array is index 1 get(array;1+1) get(array;5 raw name) get(object;raw name) get(object;raw name sub raw name) if if (expression; value1; value2) returns value 1 if the expression is evaluated to be true otherwise, it returns value 2 if(1=1;a;b) \= a if(1=2;a;b) \= b ifempty ifempty (value1; value2) returns value 1 if this value is not empty otherwise, it returns value 2 ifempty(a;b) \= a ifempty(unknown;b) \= b ifempty("";b) \= b switch switch (expression; value1; result1; \[value2; result2; ]; \[else]) evaluates one value (called the expression) against a list of values, and returns the result corresponding to the first matching value switch(b;a;1;b;2;c;3) \= 2 switch(c;a;1;b;2;c;3) \= 3 switch(x;a;1;b;2;c;3;4) \= 4 omit omit (collection; key1; \[key2; ]) removes elements with the given keys from a collection returns a collection with the remaining elements useful when you want to pass a collection to an api, which expects an exact number of elements in the collection using this function, you can make sure your collection meets the requirements of the api pick pick (collection; key1; \[key2; ]) picks elements with the given keys from a collection returns a collection that contains only the picked elements useful when you want to pass a collection to an api, which expects an exact number of elements in the collection using this function, you can make sure your collection meets the requirements of the api