General functions
Modified on Thu, 30 May at 10:33 AM
General functions let you fine-tune your mapping in a scenario. 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 in your scenarios.
Returns the ID of the current execution. Useful for logging and monitoring purposes.
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)
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
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
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
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.
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.
Was this article helpful?
That’s Great!
Thank you for your feedback
Sorry! We couldn't be helpful
Thank you for your feedback
Feedback sent
We appreciate your effort and will try to fix the article