# How do I check if a Party is in an array of Partys?

**URL:** <https://forum.canton.network/t/how-do-i-check-if-a-party-is-in-an-array-of-partys/4937>\
**Category:** App Development\
**Tags:** daml\
**Created:** [July 20, 2022, 9:36am UTC](https://forum.canton.network/t/how-do-i-check-if-a-party-is-in-an-array-of-partys/4937 "2022-07-20T09:36:28Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![frank](https://avatars.discourse-cdn.com/v4/letter/f/3d9bf3/32.png) [@frank](https://forum.canton.network/u/frank)\
**Post date:** [July 20, 2022, 9:36am UTC](https://forum.canton.network/t/how-do-i-check-if-a-party-is-in-an-array-of-partys/4937/1 "2022-07-20T09:36:28Z")

</div>

I’m trying to write a template that `ensure` that a particular party is in a list of Parties. How do I go about checking this? Do I need to convert the Party to a singleton before checking `isInfixOf` ?  
[isInfixOf](https://docs.daml.com/daml/stdlib/DA-List.html#function-da-list-isinfixof-7159)

---

<div class="post-metadata">

**Author:** ![stefanobaghino-da](https://yyz2.discourse-cdn.com/flex034/user_avatar/forum.canton.network/stefanobaghino-da/32/7057_2.png) [@stefanobaghino-da](https://forum.canton.network/u/stefanobaghino-da)\
**Post date:** [July 20, 2022, 10:12am UTC](https://forum.canton.network/t/how-do-i-check-if-a-party-is-in-an-array-of-partys/4937/2 "2022-07-20T10:12:39Z")

</div>

I believe you can use `elem`, which you can find documented [here](https://docs.daml.com/daml/stdlib/Prelude.html#function-da-internal-prelude-elem-84192).

---

<div class="post-metadata">

**Author:** ![stefanobaghino-da](https://yyz2.discourse-cdn.com/flex034/user_avatar/forum.canton.network/stefanobaghino-da/32/7057_2.png) [@stefanobaghino-da](https://forum.canton.network/u/stefanobaghino-da)\
**Post date:** [July 20, 2022, 10:14am UTC](https://forum.canton.network/t/how-do-i-check-if-a-party-is-in-an-array-of-partys/4937/3 "2022-07-20T10:14:24Z")

</div>

If you need to find other functions, I can wholeheartedly recommend using the search function in the documentation. If you look for a Daml type, you will be returned with relevant results. In this case, I looked for `[a] -> a -> Bool` as I was looking for a function that, given a list of `a` and a specific `a` could return me a boolean indicating whether the element is in the list or not.
