# Game Piece Inventory Question

**URL:** <https://forum.vassalengine.org/t/game-piece-inventory-question/11693>\
**Category:** Module Design\
**Created:** [February 18, 2021, 9:54pm UTC](https://forum.vassalengine.org/t/game-piece-inventory-question/11693 "2021-02-18T21:54:53Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Korval](https://forum.vassalengine.org/letter_avatar_proxy/v4/letter/k/ecc23a/32.png) [@Korval](https://forum.vassalengine.org/u/Korval)\
**Post date:** [February 18, 2021, 9:54pm UTC](https://forum.vassalengine.org/t/game-piece-inventory-question/11693/1 "2021-02-18T21:54:53Z")

</div>

How do you write an expression to test for existence of a property?

I want to inventory all pieces on the current map (can do this part) that have a specific property defined, regardless of the actual value and want to NOT inventory pieces that don’t have the property defined.

Example: Marker = Nation (values could be US, Germany, Italy, etc.) So I want to inventory every piece with a Marker value defined…

The VASSAL Reference Manual - Beanshell Expressions hints at the possibility (e.g., !isInUse)…

I’m virtually sure there is a way to do this, but know know the correct syntax…

---

<div class="post-metadata">

**Author:** ![marktb1961](https://forum.vassalengine.org/user_avatar/forum.vassalengine.org/marktb1961/32/231_2.png) [@marktb1961](https://forum.vassalengine.org/u/marktb1961)\
**Post date:** [February 18, 2021, 10:14pm UTC](https://forum.vassalengine.org/t/game-piece-inventory-question/11693/2 "2021-02-18T22:14:40Z")

</div>

I rely on the property being null is undefined. Of course, that doesn’t help you if null is a valid value for the property itself.
