Question

How write JSON

  • 16 September 2021
  • 6 replies
  • 12 views

Badge +10

Hi, does anyone know how to write input data to one "block?" I have input data - 8 frequency values (pic1), which are written to the dataset as individual "blocks" (pic2), but I need to write frequencies to one "block" ( pic3 ) Thanks a lot


6 replies

Userlevel 2
Badge +17

Hi @fmesafe.podpora​,

I'm sorry, but pic3 doesn't give us a clear picture of how you would like the data arranged. Would you be able to mock up what you would like to see using a text editor?

Badge +10

Hi,

ok:-) This data ( 1 - 8 ) are the data of one airport. I need this data to be within one block - all data under one featuretype .

Userlevel 2
Badge +17

Hi @fmesafe.podpora​,

It will be easiest to build the JSON list in a JSONTemplater first, then write it to the JSON writer with a data type of json.

Screen Shot 2021-09-21 at 8.50.42 AMThis produces the following JSON:

Screen Shot 2021-09-21 at 8.49.13 AMThe workspace is attached.

Badge +10

Thanks for the help, but it's not exactly what I need, as it's all together. I need to have separate branches in one block. The block is equal to the airport, the sub-branch is the name of the airport, icao kod, Cz name, en name ...., another branch of frequency + attributes of frequencies, another branch of the runway + attributes of runways, etc. the block will be one airport with branches, where each branch will have its own attributes (frequency, runways, etc.) I apologize if I do not express myself exactly. thank you very much

Badge +10

Can't anyone give me advice? Should I try to specify the problem in more detail?

Badge +13

Hi @fmesafe.podpora, The mockup you provided doesn't quite make sense with the terminology you're using in your post. Could you manually build out the JSON syntax that what you want to see as an output based on the input table screenshot you provided in your original post? It sounds like you are trying to generate nested JSON arrays within arrays. I can point you in the right direction, but needs more guidance on the final output/structure that you're looking for.

Reply