# Error run script project and shared with MongoDB

**URL:** <https://forum.inductiveautomation.com/t/error-run-script-project-and-shared-with-mongodb/11725>\
**Category:** Ignition\
**Created:** [May 26, 2016, 3:02pm UTC](https://forum.inductiveautomation.com/t/error-run-script-project-and-shared-with-mongodb/11725 "2016-05-26T15:02:47Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![andrea.montresor](https://avatars.discourse-cdn.com/v4/letter/a/5f9b8f/32.png) [@andrea.montresor](https://forum.inductiveautomation.com/u/andrea.montresor)\
**Post date:** [May 26, 2016, 3:02pm UTC](https://forum.inductiveautomation.com/t/error-run-script-project-and-shared-with-mongodb/11725/1 "2016-05-26T15:02:47Z")

</div>

Hi,

I created a module with the driver of MongoDB and it works only with a project script (with a button in a window). It is under the Script Library [project].  
Then I want to call it in the value changed of one tag. I enclose one picture.

When I try to run the script in a value changed, I have this error:

`Value Changed	Error executing script.
Traceback (most recent call last):
  File "<tagevent:valueChanged>", line 16, in valueChanged
NameError: global name 'project' is not defined
	ERROR`  
How can I do this?

I tried to put the script in shared scripts and here the scripts work, but I have the error in import library of mongoDb. So i must use a Project Section.

Can I help me?

---

<div class="post-metadata">

**Author:** ![Kevin.Herron](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/kevin.herron/32/7259_2.png) [@Kevin.Herron](https://forum.inductiveautomation.com/u/Kevin.Herron)\
**Post date:** [May 26, 2016, 3:28pm UTC](https://forum.inductiveautomation.com/t/error-run-script-project-and-shared-with-mongodb/11725/2 "2016-05-26T15:28:45Z")

</div>

You can’t run a project script from a tag - tags are global. Make it a global/shared script and it should be accessible.

---

<div class="post-metadata">

**Author:** ![andrea.montresor](https://avatars.discourse-cdn.com/v4/letter/a/5f9b8f/32.png) [@andrea.montresor](https://forum.inductiveautomation.com/u/andrea.montresor)\
**Post date:** [May 26, 2016, 3:33pm UTC](https://forum.inductiveautomation.com/t/error-run-script-project-and-shared-with-mongodb/11725/3 "2016-05-26T15:33:38Z")

</div>

I can’t put the script in a shared scripts, because in the global scripts i have the error with MongoDB library (ignition in shared script don’t find the mongodb module).  
How can I run the script also without value changed, but every 5 minutes?
