# Problem with numeric entry field and script

**URL:** <https://forum.inductiveautomation.com/t/problem-with-numeric-entry-field-and-script/79391>\
**Category:** Ignition\
**Tags:** perspective\
**Created:** [September 20, 2023, 1:29pm UTC](https://forum.inductiveautomation.com/t/problem-with-numeric-entry-field-and-script/79391 "2023-09-20T13:29:10Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Lukasz\_Wieckowski](https://avatars.discourse-cdn.com/v4/letter/l/ce7236/32.png) [@Lukasz\_Wieckowski](https://forum.inductiveautomation.com/u/Lukasz_Wieckowski)\
**Post date:** [September 20, 2023, 1:29pm UTC](https://forum.inductiveautomation.com/t/problem-with-numeric-entry-field-and-script/79391/1 "2023-09-20T13:29:10Z")

</div>

Hi everyone  
I have perspective view with numeric entry field and button with event on click script. In event script I read value from numeric entry field, multiply this value by 10 and write to tag. My script doesn't work:

def runAction(self, event):  
# Create a list with the tag paths to be updated.  
paths = [self.view.params.setpoint\_path]

```
	# Create a list with the update values, one value for each path.
	entry_value = [self.parent.parent.getChild("FlexContainer").getChild("NumericEntryField").props.value]
	
	multipland = 10
	
	setpoint = entry_value * multipland
	
	# Write operation.
	system.tag.writeBlocking(paths, setpoint)
	
	#close popup
	system.perspective.closePopup('')

```

I think that problem is in line, which multiple value from entry field by 10. Because this script work:

def runAction(self, event):  
# Create a list with the tag paths to be updated.  
paths = [self.view.params.setpoint\_path]

```
	# Create a list with the update values, one value for each path.
	entry_value = [self.parent.parent.getChild("FlexContainer").getChild("NumericEntryField").props.value]
	

	
	# Write operation.
	system.tag.writeBlocking(paths, entry_value)
	
	#close popup
	system.perspective.closePopup('')

```

How to fix this problem?

---

<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:** [September 20, 2023, 2:49pm UTC](https://forum.inductiveautomation.com/t/problem-with-numeric-entry-field-and-script/79391/2 "2023-09-20T14:49:00Z")

</div>

```python
	# store value for modification
	entry_value = self.parent.parent.getChild("FlexContainer").getChild("NumericEntryField").props.value
	multipland = 10
	# modify the value
	setpoint = entry_value * multipland
	
	# Write operation, after creating a list which contains the setpoint for every value in paths.
	system.tag.writeBlocking(paths, [setpoint for entry in paths])
	
	#close popup
	system.perspective.closePopup('')

```

---

<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:** [September 20, 2023, 3:18pm UTC](https://forum.inductiveautomation.com/t/problem-with-numeric-entry-field-and-script/79391/3 "2023-09-20T15:18:37Z")

</div>

> [@Lukasz\_Wieckowski](#):
>
> I read value from numeric entry field, multiply this value by 10 and write to tag.

Are you missing an opportunity to use the tag's scaling feature?

Some of your code formatting is messed up. See,

> [@Wiki - how to post code on this forum](https://forum.inductiveautomation.com/t/wiki-how-to-post-code-on-this-forum/77831):
>
> This thread is intended as a short help file for all those struggling to post formatted code on the forum. Posting formatted code on the forum (and most others) is as simple as selecting the code and pressing the \</\> button. It works the same as applying Bold or Italic styles to your document. It preserves indentation and applies syntax highlighting. [How to post code]

---

<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:** [September 20, 2023, 4:13pm UTC](https://forum.inductiveautomation.com/t/problem-with-numeric-entry-field-and-script/79391/4 "2023-09-20T16:13:59Z")

</div>

To further clarify the changes I recommended:

```python
a = [5]
b = 10 * a # multiplies the count of entries in the list because 'a' is a list
print(b)

>>> [5, 5, 5, 5, 5, 5, 5, 5, 5, 5]

c = 5
d = 10 * c # multiplies the number
print(d)

>>> 50

```
