Forum Discussion

Aravind711's avatar
Aravind711
New Contributor II
8 years ago

JSON Generation using JSON Generator

Hi All,

I need the below structure for creating a Tree structure in Javascript, When i execute the below structure using JSON generator (Edit JSON) am not getting any output neither error

[{

“text”: “Years”,

	"nodes": [{
		"text": $year,
		"nodes": [{
				"text": $quarter,
				"nodes": [{
					"text": $month
				}]
			}

		]
	}]
}

]

Can anyone please explain what am i missing in it.

Thanks,
Aravind

6 Replies

  • Do you have $year, $quarter, and $month defined elsewhere in the pipeline?

    If I use what you have here in a standalone JSON Generator, I get the following error:

    Failure: Failed to validate the output, Reason: Unrecognized token ‘$year’: was expecting (‘true’, ‘false’ or ‘null’), Resolution: Verify that the table values and the template are correct.

    If I put a Mapper before it to define $year, $quarter, and $month with some temporary values, the output of the JSON Generator is the tree structure with the temp values.

    • Aravind711's avatar
      Aravind711
      New Contributor II

      Yes @dmiller, I have the values for the Year, Quarter and month in the mapper snap, but when i execute i don’t receive error or either the output, can you please share you pipeline and the output image