# dataMap for running a script for report schedule

**URL:** <https://forum.inductiveautomation.com/t/datamap-for-running-a-script-for-report-schedule/18456>\
**Category:** Ignition\
**Created:** [June 13, 2018, 6:25pm UTC](https://forum.inductiveautomation.com/t/datamap-for-running-a-script-for-report-schedule/18456 "2018-06-13T18:25:46Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![cobe.karhoff](https://avatars.discourse-cdn.com/v4/letter/c/53a042/32.png) [@cobe.karhoff](https://forum.inductiveautomation.com/u/cobe.karhoff)\
**Post date:** [June 13, 2018, 6:25pm UTC](https://forum.inductiveautomation.com/t/datamap-for-running-a-script-for-report-schedule/18456/1 "2018-06-13T18:25:46Z")

</div>

I am trying to send out an email report in the run script and I want to have the ID number stored as the file name and I know that dataMap argument is able to retrieve that value since it is used in the report. Whenever I try to execute this an error shows up saying that dataMap is not defined.

---

<div class="post-metadata">

**Author:** ![uTewell](https://avatars.discourse-cdn.com/v4/letter/u/e274bd/32.png) [@uTewell](https://forum.inductiveautomation.com/u/uTewell)\
**Post date:** [November 27, 2018, 4:22pm UTC](https://forum.inductiveautomation.com/t/datamap-for-running-a-script-for-report-schedule/18456/2 "2018-11-27T16:22:20Z")

</div>

I am having a similar issue trying to access report parameters inside the Run Script Action of the report scheduler.

How do you access the report parameters inside the script?

---

<div class="post-metadata">

**Author:** ![MMaynard](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/mmaynard/32/3366_2.png) [@MMaynard](https://forum.inductiveautomation.com/u/MMaynard)\
**Post date:** [November 27, 2018, 5:46pm UTC](https://forum.inductiveautomation.com/t/datamap-for-running-a-script-for-report-schedule/18456/3 "2018-11-27T17:46:27Z")

</div>

You just reference the value in the dataset like

pName = dataMap[‘PlantName’]  
Then in the execute and distribute call you can add it in like  
“attachmentName”:“Location: " + str(pName) +” Daily Delay Report"

Replace PlantName with whatever your parameter name is.  
Note they are case sensitive as well.

---

<div class="post-metadata">

**Author:** ![uTewell](https://avatars.discourse-cdn.com/v4/letter/u/e274bd/32.png) [@uTewell](https://forum.inductiveautomation.com/u/uTewell)\
**Post date:** [November 27, 2018, 7:30pm UTC](https://forum.inductiveautomation.com/t/datamap-for-running-a-script-for-report-schedule/18456/4 "2018-11-27T19:30:05Z")

</div>

That is exactly how I am trying to utilize the function, but I keep getting an error " WARN: Unable to compile script.Traceback (most recent call last): File"",line 16, in NameError: name ‘dataMap’ is not defined

---

<div class="post-metadata">

**Author:** ![MMaynard](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/mmaynard/32/3366_2.png) [@MMaynard](https://forum.inductiveautomation.com/u/MMaynard)\
**Post date:** [November 27, 2018, 7:52pm UTC](https://forum.inductiveautomation.com/t/datamap-for-running-a-script-for-report-schedule/18456/5 "2018-11-27T19:52:27Z")

</div>

Can you post the script you are using?

---

<div class="post-metadata">

**Author:** ![uTewell](https://avatars.discourse-cdn.com/v4/letter/u/e274bd/32.png) [@uTewell](https://forum.inductiveautomation.com/u/uTewell)\
**Post date:** [November 27, 2018, 7:54pm UTC](https://forum.inductiveautomation.com/t/datamap-for-running-a-script-for-report-schedule/18456/6 "2018-11-27T19:54:11Z")

</div>

The support team figured it out. I had to start my script with an indent on every line in order to use the dataMap[].
