Reading JSON/Variant nodes

Startbeitrag von Terry Mullican am 18.04.2016 19:03

Is there a simple way to make the json node use a variable so we can loop thru the node? or Variant node, might be a more correct reference.


where id = 19, so we need the node to be:

id is a variable = 19 but this does not translate based on what we see in the debugger.

Screenshot of what the data looks like from debugger:

Screenshot of code :

Thanks for any help on this!



You should be able to build a string with the names seperated by the dot's like you would access it in the editor itself. Then use indirection { } to access its value (set or get).
A variant is a dynamic variable.

I use this methode to loop through a subset of a piece of XML. The only thing you have to be carefull for is that the name of the variable does not contain a dot.

I think, out the top of my head, code would look like this

id = 19
value is int = {"varResponse.results."+id+".rewards.bonuses"}

Hope this helped !

von Danny Lauwers - am 18.04.2016 20:01
Danny, this works, I was missing the indirection piece! Thanks!

FOR each r OF {"varResponse.results."+ id +".rewards.bonuses..Member"}

von Terry Mullican - am 18.04.2016 21:36
Zur Information: hat keinen Einfluss auf die Inhalte der Beiträge. Bitte kontaktieren Sie den Administrator des Forums bei Problemen oder Löschforderungen über die Kontaktseite.
Falls die Kontaktaufnahme mit dem Administrator des Forums fehlschlägt, kontaktieren Sie uns bitte über die in unserem Impressum angegebenen Daten.