Qualified Value in Change Script Perspective

Well, none of them worked x)
For the first two, here is theit types : class org.python.core.PyBuiltinCallable
For system.util.jsonDecode(test[0].toString()).items, I can even get his type

No idea then... guess you'll just have to use an custom prop inbetween and let ignition handle the conversion i guess xd there surely is a way but idk it, and if its this hard to figure out just a prop is easier XD

Yep, I think I will just do that, even anyone has a way to handle this, I would gladly hear it !
Anyway, thank you again for your help !

1 Like

We were struggling with a similar issue today. Our data structure is a bit different:

currentValue = [
    {
        "group_name": "group1",
        "group_id": 1
    },
    ...
]

Here’s the hack we used to solve it:

data = system.util.jsonDecode(system.util.jsonEncode(currentValue.value))

for i in range(len(currentValue.value)):
    newName = data[i]["value"]["group_name"]["value"]
    ...

Turning it into a json string and then back into a list added a ton of extra properties which is why we have to go value → group_name → value. I’d suggest doing the transform and printing it out to a text field to see the data structure you get back, then you should be able to figure out your properties you need to look up.

I hope there is a better way to do this, but we had a guy trying to figure this out for a couple days and this was the first solution that worked. So if you have another better way to do this, I’d love to see it. Otherwise, this is the solution we are moving forward with.

1 Like

Thank you dvaughn for your reply.
I think it would help some people out there. On my end, I haven’t found any better solution for now, so I’ll keep this one until we come up with something better.