# Index for triggeringItem?

**URL:** <https://community.openhab.org/t/index-for-triggeringitem/101701>\
**Category:** Scripts & Rules\
**Created:** [July 2, 2020, 3:26pm UTC](https://community.openhab.org/t/index-for-triggeringitem/101701 "2020-07-02T15:26:12Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![BW1](https://community.openhab.org/letter_avatar_proxy/v4/letter/b/aeb1de/32.png) [@BW1](https://community.openhab.org/u/BW1)\
**Post date:** [July 2, 2020, 3:26pm UTC](https://community.openhab.org/t/index-for-triggeringitem/101701/1 "2020-07-02T15:26:12Z")

</div>

Hello all,

I’d like to maintain an array of counters, where each counter corresponds to a triggeringItem in a group.

Code completion is not working in VS Code, so I have no idea what functions are available for triggeringItem. Is there something available that will work?

A second, broader question is: Is there a document that describes OpenHAB’s language in it’s entirety, with, for example, an entry for triggeringItem that shows all of it’s functions?

---

<div class="post-metadata">

**Author:** ![rlkoshak](https://community.openhab.org/user_avatar/community.openhab.org/rlkoshak/32/75251_2.png) [@rlkoshak](https://community.openhab.org/u/rlkoshak)\
**Post date:** [July 2, 2020, 4:12pm UTC](https://community.openhab.org/t/index-for-triggeringitem/101701/2 "2020-07-02T16:12:28Z")

</div>

> [@BW1](#):
>
> Code completion is not working in VS Code, so I have no idea what functions are available for triggeringItem.

`triggeringItem` is an Item. It has the same methods and properties as any other Item. Those that are relevant to Rules are documented at [Textual Rules | openHAB](https://www.openhab.org/docs/configuration/rules-dsl.html#manipulating-item-states) and [Persistence | openHAB](https://www.openhab.org/docs/configuration/persistence.html#persistence-extensions-in-scripts-and-rules) (Persistence).

> [@BW1](#):
>
> A second, broader question is: Is there a document that describes OpenHAB’s language in it’s entirety, with, for example, an entry for triggeringItem that shows all of it’s functions?

The short answer is no, there isn’t. We have [Textual Rules | openHAB](https://www.openhab.org/docs/configuration/rules-dsl.html) (follow the links on that page too) which documented Rules DSL. And there is a section that talks about what `triggeringItem` is (an implicit variable that contains the Item that caused the Rule to run). For information about the various Java Objects that might be used in an openHAB Rule, such as [GenericItem](https://www.openhab.org/javadoc/v2.5/org/eclipse/smarthome/core/items/genericitem) see the JavaDocs: [https://www.openhab.org/javadoc/v2.5](https://www.openhab.org/javadoc/v2.5).

If using Jython, JavaScript or Groovy to develop rules, see [Helper Libraries for openHAB Scripted Automation — openHAB Helper Libraries documentation](https://openhab-scripters.github.io/openhab-helper-libraries/index.html)

Documentation for building Rules through the REST API (e.g. through PaperUI) do not really exist but the first steps to document that for OH 3 is happening at [[wiki] Getting Started with OH3: rewriting the tutorial - 9. Make everything work together: rules (advanced)](https://community.openhab.org/t/wiki-getting-started-with-oh3-rewriting-the-tutorial-9-make-everything-work-together-rules-advanced/101046)

---

<div class="post-metadata">

**Author:** ![BW1](https://community.openhab.org/letter_avatar_proxy/v4/letter/b/aeb1de/32.png) [@BW1](https://community.openhab.org/u/BW1)\
**Post date:** [July 2, 2020, 4:31pm UTC](https://community.openhab.org/t/index-for-triggeringitem/101701/3 "2020-07-02T16:31:36Z")

</div>

OK thanks, so I could use a Map\<\> to store a count for each item in a group. But if I wanted to use an array, I would need an integer index of the triggeringItem within the group. Does this exist?

---

<div class="post-metadata">

**Author:** ![rlkoshak](https://community.openhab.org/user_avatar/community.openhab.org/rlkoshak/32/75251_2.png) [@rlkoshak](https://community.openhab.org/u/rlkoshak)\
**Post date:** [July 2, 2020, 6:16pm UTC](https://community.openhab.org/t/index-for-triggeringitem/101701/4 "2020-07-02T18:16:36Z")

</div>

Honestly, this smells like an XY Problem. What is it you are really trying to achieve? What are you wanting to do with this count?
