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

**URL:** <https://forum.inductiveautomation.com/t/view-params-object-passing-to-script-error-while-accessing-list-dictionary-item/57578>\
**Category:** Ignition\
**Tags:** perspective\
**Created:** [March 24, 2022, 12:10pm UTC](https://forum.inductiveautomation.com/t/view-params-object-passing-to-script-error-while-accessing-list-dictionary-item/57578 "2022-03-24T12:10:48Z")\
**Posts on this page:** 6\
**Page:** 2

<div class="post-metadata">

**Author:** ![victordcq](https://avatars.discourse-cdn.com/v4/letter/v/f6c823/32.png) [@victordcq](https://forum.inductiveautomation.com/u/victordcq)\
**Post date:** [March 24, 2022, 2:54pm UTC](https://forum.inductiveautomation.com/t/view-params-object-passing-to-script-error-while-accessing-list-dictionary-item/57578/21 "2022-03-24T14:54:49Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![lrose](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/lrose/32/62724_2.png) [@lrose](https://forum.inductiveautomation.com/u/lrose)\
**Post date:** [March 24, 2022, 3:30pm UTC](https://forum.inductiveautomation.com/t/view-params-object-passing-to-script-error-while-accessing-list-dictionary-item/57578/22 "2022-03-24T15:30:28Z")

</div>

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` 🤷🏾‍♂️

So `system.util.jsonDecode()` doesn’t work. Anyway, this does work:

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

```

---

<div class="post-metadata">

**Author:** ![Transistor](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/transistor/32/3380_2.png) [@Transistor](https://forum.inductiveautomation.com/u/Transistor)\
**Post date:** [March 24, 2022, 3:31pm UTC](https://forum.inductiveautomation.com/t/view-params-object-passing-to-script-error-while-accessing-list-dictionary-item/57578/23 "2022-03-24T15:31:25Z")

</div>

> [@victordcq](#):
>
> what if you call your script in the transform script

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.

 ![Shift expression script binding](https://us1.discourse-cdn.com/inductiveautomation/original/3X/0/a/0a3694ab17d617e7088436e9a7dd7f95ee1f98c4.png)

Thank you!

---

<div class="post-metadata">

**Author:** ![victordcq](https://avatars.discourse-cdn.com/v4/letter/v/f6c823/32.png) [@victordcq](https://forum.inductiveautomation.com/u/victordcq)\
**Post date:** [March 24, 2022, 3:36pm UTC](https://forum.inductiveautomation.com/t/view-params-object-passing-to-script-error-while-accessing-list-dictionary-item/57578/24 "2022-03-24T15:36:47Z")

</div>

> [@Transistor](#):
>
> The only additional trick was to give a dummy binding to feed into the transform

you should use an expression struct and bind on these params

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

```

---

<div class="post-metadata">

**Author:** ![Transistor](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/transistor/32/3380_2.png) [@Transistor](https://forum.inductiveautomation.com/u/Transistor)\
**Post date:** [March 24, 2022, 3:39pm UTC](https://forum.inductiveautomation.com/t/view-params-object-passing-to-script-error-while-accessing-list-dictionary-item/57578/25 "2022-03-24T15:39:07Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![tupanaster](https://avatars.discourse-cdn.com/v4/letter/t/5daacb/32.png) [@tupanaster](https://forum.inductiveautomation.com/u/tupanaster)\
**Post date:** [June 19, 2022, 1:39pm UTC](https://forum.inductiveautomation.com/t/view-params-object-passing-to-script-error-while-accessing-list-dictionary-item/57578/26 "2022-06-19T13:39:05Z")

</div>

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

> [@victordcq](#):
>
> what if you call your script in the transform script

I was also calling scripts only from Expression transforms.

> [@Transistor](#):
>
> Ooooh! Well that makes a difference

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.

> [@Transistor](#):
>
> That makes sense - otherwise the binding wouldn’t update on date change, etc.  
> I’ll have to look at it later.

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`

[Previous page](https://forum.inductiveautomation.com/t/view-params-object-passing-to-script-error-while-accessing-list-dictionary-item/57578.md?page=1)
