# Library Function Call from runScript

**URL:** <https://forum.inductiveautomation.com/t/library-function-call-from-runscript/89141>\
**Category:** Ignition\
**Tags:** scripting, ignition81\
**Created:** [April 19, 2024, 8:16pm UTC](https://forum.inductiveautomation.com/t/library-function-call-from-runscript/89141 "2024-04-19T20:16:29Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![amarks](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/amarks/32/45610_2.png) [@amarks](https://forum.inductiveautomation.com/u/amarks)\
**Post date:** [April 19, 2024, 8:16pm UTC](https://forum.inductiveautomation.com/t/library-function-call-from-runscript/89141/1 "2024-04-19T20:16:29Z")

</div>

I have a project library script that works when I call it from the script console but I can't get a `runScript()` expression to work with it, for whatever reason. I get correct results in the console and I'm calling the function the exact same way.

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

```python
runScript("Data.getCommodityOptionDataset('[default]Bins/Commodities', 21)")

```

---

<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:** [April 19, 2024, 8:18pm UTC](https://forum.inductiveautomation.com/t/library-function-call-from-runscript/89141/2 "2024-04-19T20:18:02Z")

</div>

Where is the `runScript` expression being used?

---

<div class="post-metadata">

**Author:** ![amarks](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/amarks/32/45610_2.png) [@amarks](https://forum.inductiveautomation.com/u/amarks)\
**Post date:** [April 19, 2024, 8:19pm UTC](https://forum.inductiveautomation.com/t/library-function-call-from-runscript/89141/3 "2024-04-19T20:19:08Z")

</div>

Expression dataset tag

---

<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:** [April 19, 2024, 8:19pm UTC](https://forum.inductiveautomation.com/t/library-function-call-from-runscript/89141/4 "2024-04-19T20:19:51Z")

</div>

In that case, the project your library is defined in must be configured as the Gateway Scripting Project.

See [Project Library | Ignition User Manual](https://docs.inductiveautomation.com/docs/8.1/platform/scripting/scripting-in-ignition/project-library#gateway-scripting-project)

---

<div class="post-metadata">

**Author:** ![michael.flagler](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/michael.flagler/32/26272_2.png) [@michael.flagler](https://forum.inductiveautomation.com/u/michael.flagler)\
**Post date:** [April 19, 2024, 8:23pm UTC](https://forum.inductiveautomation.com/t/library-function-call-from-runscript/89141/5 "2024-04-19T20:23:37Z")

</div>

Also, that's the legacy method of calling the runScript expression. New way would be something like:

```python
runScript('Data.getCommodityOptionDataset', 0, '[default]Bins/Commodities', 21)

```

---

<div class="post-metadata">

**Author:** ![amarks](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/amarks/32/45610_2.png) [@amarks](https://forum.inductiveautomation.com/u/amarks)\
**Post date:** [April 19, 2024, 8:25pm UTC](https://forum.inductiveautomation.com/t/library-function-call-from-runscript/89141/6 "2024-04-19T20:25:03Z")

</div>

Would be nice if there was a prompt on the gateway webpage after creating the first project asking if you would like to set the project as the gateway scripting project. I know I've had this happen before
