How to check the length of 2 contract lists in DAML Triggers?
App Development5 posts155 viewsLast activity Feb 2023
PR
Pris17OP
Feb 2023I 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?
GA
Gary_Verhaegen
Feb 2023Is the length function what you’re after? Otherwise, can you please share a little bit more of your code, to make your question a bit clearer?
PR
Pris17
Feb 2023can you share a sample code for length function to compare 2 lists?
CO
cocreature
Feb 2023Here is an example:
test = script do
let xs = [1,2]
let ys = [1,2,3]
assert (length xs < length ys)
PR
Pris17
Feb 2023Thanks @cocreature