Question - New JSON functions 2021x

Thanks to @EH for wiki page very helpful to get started.

[CATIA] Templates, Optimization & Rules Designer

There are are some functions not covered in the wiki example that I feel could be useful. After reviewing the help docs, I am left with wanting an example that helps put together the concepts of how these functions are used.

1. Parse: JSONNode.Parse(iJSONString : String) : String

  • The Parse Function is used to parse a string into a JSON Object, but returns a string.  I am unsure how to take advantage of it.

2. Stringify: JSONNode.Stringify() : String

  • The STRINGIFY method converts a JSONNode data to a JSON formatted EKL string. This function is used to display the object in an easy format.  This will display the JSON in a popup message indented format.  Not sure how it is useful in EKL to extract data or it is just for viewing the formatted JSON?

3. Map: functions to manage lists of keys and values.

  • Map.Add(): The Add method is used to insert a key-value pair in the map.
  • Map.Get(): The Get method retrieves the value corresponding to the respective key present in the map.
  • Map.Remove(): The Remove method is used to delete the entry of the key-value pair present in the map.
  • Map.Replace(): The Replace method updates the value of input key present in the map.
  • Map.ToLists(): The ToLists method is used to segregate the keys and values of the map to different lists.

I reproduced the example created by @EH to enable others to discover some basics of JSON EKL.  Thanks in advance for contributing to the discussion. 

​​​​​​​​​​​​​​

** Update after chipping away at Map functions **

I am able to Map key and value pairs in a Loop.

In this example I created 3 Map objects as yo need to declare the Type of data that will populated list.  Still unsure how to take advantage of JSONNode.Parse() and JSONNode.Stringify()