visibleByKey Alternative

Hello, good day! I would like to ask if we have an alternative for visibleByKey within a DAML choice, since my objective is to locate a parameter into a given contract, but it is not part of the contract’s key.

If there’s no alternative, what could be the possible workaround for this one.

Under DAML v1.16.0

Appreciate your help, thanks!

Hi @carleslabon, I’m not quite sure I understand your question correctly. Are you trying to query for contracts with given fields set to a given value with those values being different from the contract key? I assume you also need a version of lookupByKey/fetchByKey instead of only visibileByKey?

Hello @cocreature, yes, I need to query a contract with a given field which is different from the contract key.

The only form of queries available within Daml choices is querying by contract key. So either you find a way to express it using those (if you provide more details on your model, maybe someone has a suggestion) or alternatively you query on the client side and pass the result as a choice argument.

1 Like

Noted on this one, thanks!