# Pass parameter to tag.writeAsync

**URL:** <https://forum.inductiveautomation.com/t/pass-parameter-to-tag-writeasync/43485>\
**Category:** Ignition\
**Tags:** ignition80\
**Created:** [February 16, 2021, 9:12pm UTC](https://forum.inductiveautomation.com/t/pass-parameter-to-tag-writeasync/43485 "2021-02-16T21:12:07Z")\
**Posts on this page:** 1\
**Showing post:** 5

<div class="post-metadata">

**Author:** ![pturmel](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pturmel/32/3295_2.png) [@pturmel](https://forum.inductiveautomation.com/u/pturmel)\
**Post date:** [February 17, 2021, 2:01pm UTC](https://forum.inductiveautomation.com/t/pass-parameter-to-tag-writeasync/43485/5 "2021-02-17T14:01:16Z")

</div>

You _really_ don't want to call readBlocking() in a loop. See this topic for an example of combining many tag reads into a single call, then looping through the grouped results:

> [@Best Practices for Querying Tag History Data \[SOLVED\]](http://forum.inductiveautomation.com/t/best-practices-for-querying-tag-history-data-solved/43427/12):
>
> The code will run much faster if you don’t split these up. Read all of them at once. Consider using a project script module top level variable to hold the constructed list of tag paths, so that part won’t have to execute every time. (I strongly recommend placing all gateway event code in a project script module, leaving just a one-line function call in the event itself.) Something like this: # In a script, "bots", perhaps # Base path and channel names basepath = "[default]Alphabot/05 Bot …

I would also construct a SQL INSERT statement with a multi-row VALUES clause, permitting a single DB call as well.

---

_[View the full topic](https://forum.inductiveautomation.com/t/pass-parameter-to-tag-writeasync/43485)._
