# Call a function in a tag

**URL:** <https://forum.inductiveautomation.com/t/call-a-function-in-a-tag/29408>\
**Category:** General Discussion\
**Created:** [October 25, 2019, 6:39pm UTC](https://forum.inductiveautomation.com/t/call-a-function-in-a-tag/29408 "2019-10-25T18:39:23Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Brown](https://avatars.discourse-cdn.com/v4/letter/b/7bcc69/32.png) [@Brown](https://forum.inductiveautomation.com/u/Brown)\
**Post date:** [October 25, 2019, 6:39pm UTC](https://forum.inductiveautomation.com/t/call-a-function-in-a-tag/29408/1 "2019-10-25T18:39:24Z")

</div>

I have a function defined in project library. I called the function when the tag changes.  
what i want is that this function be run 5 times when the tag changes. i have to try with the loops but it’s not working  
x = 1  
while x \< 5:  
script.myfunction()  
x = x +1
