Include JSON File

Hi,

I think there was some kind of a json file binding for building up lists and tables with content. Is this still available in the web version? Is there an example file for that?

Best regards
Chris

Hi Chris,

we have one example in the “Data Binding Example”:

Currently you need to paste the json inside the header_include.html since we do not support external files. If you have further questions don’t hesitate to ask …

Cheers,

Felix

Hi Felix,

Thank you for your quick response. I was blind :slight_smile: I found it and it works now.

Best regards,
Chris

1 Like

I am trying to feed menus with different skins the values from the file. All working well until I add more objects. I want all these menu entries to receive values from the JSON data but only the first one in the list gets it:
image
Howdo I need to tweak this script?
loadJSON(targetCells[0], "Menu1")

this is an example we developed in a workshop (and did not really clean it up … ). The script is inside the header_include.html.

It replaces the contents of the container (here “TodayData” and “TomorrowData”) with similar rows, but the text-content is used from the data-Object in the header_include, mapping the values using NameInJavaScript -> $NameInJavaScript (in Antetype).

menu binding.zip (257.9 KB)

Here a simplified example, with a structure similar to yours.

Does this help?

I got that to work using the example you mentioned above. Quite straigt-forward. My question was how can I feed several “$Entry”-cells with the same value from the JSON file? Think of these as skins for Mac Aqua, mac dark mode and Windows. I just don’t want to fill up each menu individually. image

To be even more specific: if I just duplicate the “$Entry”-cell, only one will receive the values, not both.

in the current form the script replaces multiple $Entry values inside the Entry cell:

do you want to replace cells named $Entry outside of the repeated entries? :thinking:

Hmmm… in your example it seems to work, in mine it doesn’t. I’ll compare the two files and see what’s different. Thanks!