# Perspective: Bind instance parameter using scripts

**URL:** <https://forum.inductiveautomation.com/t/perspective-bind-instance-parameter-using-scripts/61618>\
**Category:** Ignition\
**Tags:** perspective, ignition81\
**Created:** [July 7, 2022, 11:39am UTC](https://forum.inductiveautomation.com/t/perspective-bind-instance-parameter-using-scripts/61618 "2022-07-07T11:39:33Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![ISEMAREN\_AAG](https://avatars.discourse-cdn.com/v4/letter/i/82dd89/32.png) [@ISEMAREN\_AAG](https://forum.inductiveautomation.com/u/ISEMAREN_AAG)\
**Post date:** [July 7, 2022, 11:39am UTC](https://forum.inductiveautomation.com/t/perspective-bind-instance-parameter-using-scripts/61618/1 "2022-07-07T11:39:33Z")

</div>

Good morning.

In Ignition **8.1.15** , I have written a **script** to build the view **instances** of a **Flex Repeater**. One of the view’s parameters is a tag value, and I’d like to **bind** it through the script.  
If I just assign the value to the parameter, it logically doesn’t bind to the tag, and the parameter won’t change when the tag value changes.

 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/e/8/e862c76912289b5c3e45774195acb7e399aff6f7.png)

As I have programmed the script, “tagValue” is static, I need it to be dynamic.

Best regards.

---

<div class="post-metadata">

**Author:** ![JordanCClark](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/jordancclark/32/83362_2.png) [@JordanCClark](https://forum.inductiveautomation.com/u/JordanCClark)\
**Post date:** [July 7, 2022, 11:50am UTC](https://forum.inductiveautomation.com/t/perspective-bind-instance-parameter-using-scripts/61618/2 "2022-07-07T11:50:59Z")

</div>

Instead of passing the value to the tagValue parameter, add an indrect tag binding on tagValue in the view.

---

<div class="post-metadata">

**Author:** ![ISEMAREN\_AAG](https://avatars.discourse-cdn.com/v4/letter/i/82dd89/32.png) [@ISEMAREN\_AAG](https://forum.inductiveautomation.com/u/ISEMAREN_AAG)\
**Post date:** [July 7, 2022, 2:04pm UTC](https://forum.inductiveautomation.com/t/perspective-bind-instance-parameter-using-scripts/61618/3 "2022-07-07T14:04:28Z")

</div>

I have created a new parameter (_ **tagPath** _) in the view and bound the label to this parameter:

![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/f/7/f7d1d02480e960616faf1be445c8a9017eb8db5f.png)

I have modified the script that creates the instances in the Flex Repeater, but the final result is not what I expected. Instead of displaying the value of the tag, “value” is displayed:

**Script** :

 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/1/d/1d3cb77219b11265a6e458d8e209e44885688b6c.png)

**Flex Repeater:**  
 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/5/f/5f24d122ffe05952edaea38aa9b66269a9a5b03a.png)

Best Regards.

---

<div class="post-metadata">

**Author:** ![JordanCClark](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/jordancclark/32/83362_2.png) [@JordanCClark](https://forum.inductiveautomation.com/u/JordanCClark)\
**Post date:** [July 7, 2022, 2:24pm UTC](https://forum.inductiveautomation.com/t/perspective-bind-instance-parameter-using-scripts/61618/4 "2022-07-07T14:24:42Z")

</div>

Use an indirect tag binding, add a script transform to add the units. My example uses a custom property called _tagValue_  
 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/1/e/1e0ba9175b7fda456f10260a44022138f06319e0.png)

binding on tagValue

 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/2/8/288a65d1598a6cfba522b1ba737a0d66e060792e.png)

Transform script:

```python
def transform(self, value, quality, timestamp):
	stringOut = '{} {}'.format(value, self.params.tagUnits)
	return stringOut

```

---

<div class="post-metadata">

**Author:** ![ISEMAREN\_AAG](https://avatars.discourse-cdn.com/v4/letter/i/82dd89/32.png) [@ISEMAREN\_AAG](https://forum.inductiveautomation.com/u/ISEMAREN_AAG)\
**Post date:** [July 7, 2022, 5:14pm UTC](https://forum.inductiveautomation.com/t/perspective-bind-instance-parameter-using-scripts/61618/5 "2022-07-07T17:14:02Z")

</div>

It works perfectly with both Expression Binding and Indirect Tag Binding.

> [@Perspective: Bind instance parameter using scripts](https://forum.inductiveautomation.com/t/perspective-bind-instance-parameter-using-scripts/61618/3):
>
> I have created a new parameter (tagPath) in the view and bound the label to this parameter: [image] I have modified the script that creates the instances in the Flex Repeater, but the final result is not what I expected. Instead of displaying the value of the tag, “value” is displayed: Script: Flex Repeater: [image] Best Regards.

I was editing the wrong view ☹

Thanks.

---

<div class="post-metadata">

**Author:** ![JordanCClark](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/jordancclark/32/83362_2.png) [@JordanCClark](https://forum.inductiveautomation.com/u/JordanCClark)\
**Post date:** [July 7, 2022, 5:53pm UTC](https://forum.inductiveautomation.com/t/perspective-bind-instance-parameter-using-scripts/61618/6 "2022-07-07T17:53:34Z")

</div>

I wish i could say I’ve never done that. But I have. Sometimes often.
