# Use script from project library in report datasource

**URL:** <https://forum.inductiveautomation.com/t/use-script-from-project-library-in-report-datasource/85176>\
**Category:** Ignition\
**Tags:** reporting\
**Created:** [February 2, 2024, 8:46pm UTC](https://forum.inductiveautomation.com/t/use-script-from-project-library-in-report-datasource/85176 "2024-02-02T20:46:13Z")\
**Posts on this page:** 1\
**Showing post:** 7

<div class="post-metadata">

**Author:** ![lrose](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/lrose/32/62724_2.png) [@lrose](https://forum.inductiveautomation.com/u/lrose)\
**Post date:** [February 5, 2024, 2:46pm UTC](https://forum.inductiveautomation.com/t/use-script-from-project-library-in-report-datasource/85176/7 "2024-02-05T14:46:03Z")

</div>

Here's a script which can be used to determine the scope. In cases where a library script may be called from multiple scopes.

> [@Can I tell what scope a script is running from?](https://forum.inductiveautomation.com/t/can-i-tell-what-scope-a-script-is-running-from/70880/8):
>
> This is what we do to determine scope in a script from com.inductiveautomation.ignition.common.model import ApplicationScope def getScope(): scope = ApplicationScope.getGlobalScope() if ApplicationScope.isClient(scope): return "c" if ApplicationScope.isDesigner(scope): return "d" if ApplicationScope.isGateway(scope): if "perspective" in dir(system): return "p" return "g" return "u"

---

_[View the full topic](https://forum.inductiveautomation.com/t/use-script-from-project-library-in-report-datasource/85176)._
