How to check the length of 2 contract lists in DAML Triggers?
- Pris17OP
I have fetched 2 contract lists by T.queryContractKey in DAML Trigger and applied some filters on it. Now I want to compare the size or length of the contract list.
How can I do that?
- Gary_Verhaegen
Is the
lengthfunction what you’re after? Otherwise, can you please share a little bit more of your code, to make your question a bit clearer? - Pris17
can you share a sample code for length function to compare 2 lists?
- cocreature
Here is an example:
test = script do let xs = [1,2] let ys = [1,2,3] assert (length xs < length ys) - Pris17
Thanks @cocreature