# Fetch contract by key for use in choice or ensure

**URL:** <https://forum.canton.network/t/fetch-contract-by-key-for-use-in-choice-or-ensure/4564>\
**Category:** App Development\
**Created:** [May 18, 2022, 11:59pm UTC](https://forum.canton.network/t/fetch-contract-by-key-for-use-in-choice-or-ensure/4564 "2022-05-18T23:59:58Z")\
**Posts on this page:** 1\
**Showing post:** 11

<div class="post-metadata">

**Author:** ![StephenOTT](https://yyz2.discourse-cdn.com/flex034/user_avatar/forum.canton.network/stephenott/32/3953_2.png) [@StephenOTT](https://forum.canton.network/u/StephenOTT)\
**Post date:** [May 23, 2022, 12:12pm UTC](https://forum.canton.network/t/fetch-contract-by-key-for-use-in-choice-or-ensure/4564/11 "2022-05-23T12:12:30Z")

</div>

@Gary_Verhaegen thank you for the detailed response. The pattern I keep coming back to is: using role-contracts and modifying readAs as per [Internal templates? (templates/contracts that can only be created by other template choices?) - #22 by StephenOTT](https://discuss.daml.com/t/internal-templates-templates-contracts-that-can-only-be-created-by-other-template-choices/4536/22)

---

_[View the full topic](https://forum.canton.network/t/fetch-contract-by-key-for-use-in-choice-or-ensure/4564)._
