View.params object passing to script - error while accessing list dictionary item

yes but what if you call your script in the transform script and use an structured expression binding

1 Like

Iā€™m not sure why, but for whatever reason, even if you build the structure in the designer, you do indeed end up getting class com.inductiveautomation.perspective.comonImmutableQualifiedValue :man_shrugging:t5:

So system.util.jsonDecode() doesnā€™t work. Anyway, this does work:

shiftPat = []
for v in value:
    shifPat.append({k:v.value[k] for k in v.value.keys()})

Ooooh! Well that makes a difference. It seems that the script passes the list of dictionaries through without harm! The only additional trick was to give a dummy binding to feed into the transform.

Thank you!

you should use an expression struct and bind on these params

{session.custom.datePicker},
{view.params.config.shiftPattern}

That makes sense - otherwise the binding wouldnā€™t update on date change, etc.
Iā€™ll have to look at it later.

@Transistor thanks for starting the thread. I was having the same problem.

I was also calling scripts only from Expression transforms.

Indeed!
When using Expression transforms, the type passed is ImmutableQualifiedValue. I was having a hard time getting around it, but Script transform did the trick.

Probably you already solved it. In case you haven't, your first expression binding would be bind to a date change instead of a dummy true

1 Like