Loop with complex structure....
Hello all,
I have a variable like the following :
myvar = {
instance1 = {
subinstance1 = {
mystring = "testing1"
mylist = ["hello", "world"]
}
subinstance2 = {
mystring = "testing2"
mylist = ["foo", "bar", "yosh"]
}
}
}
Now I want to do a loop over the items in each "mylist", but I also need to reference the key parent (subinstanceN)
So I would need to transform my variable to something like this :
{
"name": subinstance1
"itemlist": "hello"
},
"name": subinstance1
"itemlist": "world"
},
"name": subinstance2
"itemlist": "foo"
},
"name": subinstance2
"itemlist": "bar"
},
"name": subinstance2
"itemlist": "yosh"
}
I tried with setproduct function but without success... Any help would be appreciated !
Thanks