# Counter concept in Perspective

**URL:** <https://forum.inductiveautomation.com/t/counter-concept-in-perspective/49808>\
**Category:** Ignition\
**Created:** [August 11, 2021, 12:50pm UTC](https://forum.inductiveautomation.com/t/counter-concept-in-perspective/49808 "2021-08-11T12:50:34Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![jimeliot.d](https://avatars.discourse-cdn.com/v4/letter/j/43a26b/32.png) [@jimeliot.d](https://forum.inductiveautomation.com/u/jimeliot.d)\
**Post date:** [August 11, 2021, 12:50pm UTC](https://forum.inductiveautomation.com/t/counter-concept-in-perspective/49808/1 "2021-08-11T12:50:34Z")

</div>

I would like to create a countdown timer in the progress bar component using value change script however I’m facing issues the script runs fine but the value in the progress bar does not change.

Any light on this issues?

Much Appreciated, Thank you.  
 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/b/c/bcfed53b26c28523a53f293b38e71969a9c45abe.png)

this is the scripting I have written for countdown timer

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

---

<div class="post-metadata">

**Author:** ![bkarabinchak.psi](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/bkarabinchak.psi/32/83567_2.png) [@bkarabinchak.psi](https://forum.inductiveautomation.com/u/bkarabinchak.psi)\
**Post date:** [August 11, 2021, 1:08pm UTC](https://forum.inductiveautomation.com/t/counter-concept-in-perspective/49808/2 "2021-08-11T13:08:07Z")

</div>

Where are you assigning the component prop you are trying to change? I don’t see a line that is trying to update your GUI.

---

<div class="post-metadata">

**Author:** ![cmallonee](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/cmallonee/32/6416_2.png) [@cmallonee](https://forum.inductiveautomation.com/u/cmallonee)\
**Post date:** [August 11, 2021, 3:32pm UTC](https://forum.inductiveautomation.com/t/counter-concept-in-perspective/49808/3 "2021-08-11T15:32:04Z")

</div>

The problem with your code is that `j` is a value - not a reference. So even though you’re decrementing `j`, you are never telling the Progress Bar to use the new value.

```auto

while self.props.selected and j > 0:
    time.sleep(1)
    j -= 1
    self.parent.getChild("FlexContainer").getChild("FlexContainer_0").getChild("Progress").props.value = j

```

---

<div class="post-metadata">

**Author:** ![jimeliot.d](https://avatars.discourse-cdn.com/v4/letter/j/43a26b/32.png) [@jimeliot.d](https://forum.inductiveautomation.com/u/jimeliot.d)\
**Post date:** [August 11, 2021, 4:54pm UTC](https://forum.inductiveautomation.com/t/counter-concept-in-perspective/49808/4 "2021-08-11T16:54:11Z")

</div>

j = self.parent.getChild(“FlexContainer”).getChild(“FlexContainer\_0”).getChild(“Progress”).props.value

this is the component I was trying to assign the new value

---

<div class="post-metadata">

**Author:** ![bkarabinchak.psi](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/bkarabinchak.psi/32/83567_2.png) [@bkarabinchak.psi](https://forum.inductiveautomation.com/u/bkarabinchak.psi)\
**Post date:** [August 11, 2021, 4:57pm UTC](https://forum.inductiveautomation.com/t/counter-concept-in-perspective/49808/5 "2021-08-11T16:57:18Z")

</div>

Right. As @cmallonee said, this only assigns the current value to j, not a reference to .props.value.

So you need to do

```auto
self.parent.getChild(“FlexContainer”).getChild(“FlexContainer_0”).getChild(“Progress”).props.value = someNewvalue

```

instead.

I think _ **maybe** _ you could do

```auto
j = self.parent.getChild(“FlexContainer”).getChild(“FlexContainer_0”).getChild(“Progress”)
j.props.value = someNewValue

```

if you really wanted to, but I don’t think this makes anything more readable or gives any advantage.

---

<div class="post-metadata">

**Author:** ![jimeliot.d](https://avatars.discourse-cdn.com/v4/letter/j/43a26b/32.png) [@jimeliot.d](https://forum.inductiveautomation.com/u/jimeliot.d)\
**Post date:** [August 12, 2021, 3:34am UTC](https://forum.inductiveautomation.com/t/counter-concept-in-perspective/49808/6 "2021-08-12T03:34:28Z")

</div>

@cmallonee Thank you for your help
