Skip to content
CCPEDIAby Unity Nodes
App Development

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

3 posts323 views1 likesLast activity Jul 2022

  1. frankOP

    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

  2. stefanobaghino-da

    I believe you can use elem, which you can find documented here.

  3. stefanobaghino-da 1

    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.