# Passing strings to scripts

**URL:** <https://forum.inductiveautomation.com/t/passing-strings-to-scripts/104732>\
**Category:** Ignition\
**Tags:** namedqueries, scripting\
**Created:** [April 4, 2025, 6:00pm UTC](https://forum.inductiveautomation.com/t/passing-strings-to-scripts/104732 "2025-04-04T18:00:54Z")\
**Posts on this page:** 1\
**Showing post:** 3

<div class="post-metadata">

**Author:** ![Transistor](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/transistor/32/3380_2.png) [@Transistor](https://forum.inductiveautomation.com/u/Transistor)\
**Post date:** [April 4, 2025, 6:31pm UTC](https://forum.inductiveautomation.com/t/passing-strings-to-scripts/104732/3 "2025-04-04T18:31:38Z")

</div>

Tips:

- Don't post code as a quotation ". Post it as preformatted text \</\>. Please see [Wiki - how to post code on this forum](https://forum.inductiveautomation.com/t/wiki-how-to-post-code-on-this-forum/77831).
- Add a space after every punctuation (`,` and `:`) as you would in written English, and both sides of `=`. This will help when text needs to wrap and improve general legibility.

```python
hrbyhrKey = 36
losttime = 15
freeform = "freeform text 55"
lossKey = 14
workcellKey = 15

paramlist = {"FreeForm": freeform, 
  "HrByHrKey": hrbyhrKey, 
  "LossKey": lossKey, 
  "LostTime_Mins": losttime, 
  "WorkcellGroupMemberKey": workcellKey
}
results = system.db.runNamedQuery(path = namedquerypathvalue, 
 parameters = paramlist, getkey = 1)

print results

```

---

_[View the full topic](https://forum.inductiveautomation.com/t/passing-strings-to-scripts/104732)._
