Skip to content
CCPEDIAby Unity Nodes
Discussions/App Development/visibleByKey AlternativeForum ↗

visibleByKey Alternative

App Development5 posts141 views1 likesLast activity Feb 2022
CA
carleslabonOP
Feb 2022

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!

CO
cocreature
Feb 2022

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?

CA
carleslabon
Feb 2022

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

CO
cocreature
Feb 2022

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.

CA
carleslabon
Feb 2022

Noted on this one, thanks!

← Back to Discussions