Tips for Mapping and Cleanse Rule

This section share some tips and information on how to empower the mapping and cleanse rule on Carol.

Date/Time formatting

Carol allows parsing any kind of string to a date. For that, we use the power of date formating provided by Java.

The cleanse function "Date Format" allows us to apply this rule. For example:

17041704

For a full list of functions and how to apply it for different scenarios, please, take a look on Java Documentation at https://docs.oracle.com/javase/10/docs/api/java/text/SimpleDateFormat.html

JSON Path

Json Path allows us to convert any string to an object (or array) and to extract any information from it. It allows us a very simple field extraction or works with arrays and get the last/first element of it. Or even apply conditions to extract from an array only the elements you want.

Documentation: https://goessner.net/articles/JsonPath/

Online evaluator (good for complex scenarios): http://jsonpath.com/

Source code (only for information): https://github.com/json-path/JsonPath

17021702

Additional information

  • You can use even Carol as a Json Path evaluator, using the right panel to test/validate your whole cleanse rule.

  • You can download the application jq (shell command) and play with Json Path in other scenarios as well.