Need to get the values of the objects (JSON) which have been created dynamically
<p>How to get the top object value in PentahoDI? I have got the other elements like Category, Subcategory, section from the following example of Json file. However, I need to capture the first root object which is <code>x@chapter@e50de0196d77495d9b50fc05567b4a4b</code> and <code>x@e50de0196d77495d9b50fc05567b4a4b</code></p>

<pre><code>{
    "x@chapter@e50de0196d77495d9b50fc05567b4a4b": {
        "Category": "chapter", 
        "SubCategory": [
            "x@4eb9072cf36f4d6fa1e98717e6bb54f7", 
            "x@d85849fbde324690b6067f3b18c4258d", 
            "x@3edff1a1864f41fe8b212df2bc96bf13"
        ], 
        "Section": {
            "display_name": "Week 1 Section"
        }
    }, 
    "x@e50de0196d77495d9b50fc05567b4a4b": {
        "category": "course", 
        "Subcategory": [
            "x@e50de0196d77495d9b50fc05567b4a4b"
        ], 
        "Section": {
            "advanced_modules": [
                "google-document"
            ], 
        }
    }
}
</code></pre>

<p>In the Fields tab of the Json Input step I have given the Names and Paths as: Category --> $..Category, Subcategory --> $..Subcategory, Section --> $..Section.</p>

<p>However, I am unable to get the root element as it is crucial information for us to work on it. ex (<code>x@chapter@e50de0196d77495d9b50fc05567b4a4b</code> and <code>x@e50de0196d77495d9b50fc05567b4a4b</code>)</p>

<p>I have used the following code to get the values of the dynamic objects but it didnt work. The following is the code I used it.</p>

<pre><code>var obj = JSON.parse (JBlock) //Jblock is the one which holds the entire string.
var keys = Object.name( obj);
</code></pre>