# Can you do partial/substring Text matches in JSON API queries?

**URL:** <https://forum.canton.network/t/can-you-do-partial-substring-text-matches-in-json-api-queries/4070>\
**Category:** App Development\
**Tags:** json-api\
**Created:** [March 7, 2022, 6:06am UTC](https://forum.canton.network/t/can-you-do-partial-substring-text-matches-in-json-api-queries/4070 "2022-03-07T06:06:09Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![meet](https://yyz2.discourse-cdn.com/flex034/user_avatar/forum.canton.network/meet/32/198_2.png) [@meet](https://forum.canton.network/u/meet)\
**Post date:** [March 7, 2022, 6:06am UTC](https://forum.canton.network/t/can-you-do-partial-substring-text-matches-in-json-api-queries/4070/1 "2022-03-07T06:06:09Z")

</div>

If you have a `Text` field on a contract with a value, say, “Hello World”, could you do a partial/substring match on it using JSON API - so, for example, query for all contracts where the `field contains 'World'`?

If not, is this on the roadmap?

---

<div class="post-metadata">

**Author:** ![stefanobaghino-da](https://yyz2.discourse-cdn.com/flex034/user_avatar/forum.canton.network/stefanobaghino-da/32/7057_2.png) [@stefanobaghino-da](https://forum.canton.network/u/stefanobaghino-da)\
**Post date:** [March 7, 2022, 7:49am UTC](https://forum.canton.network/t/can-you-do-partial-substring-text-matches-in-json-api-queries/4070/2 "2022-03-07T07:49:02Z")

</div>

This is not currently supported and to the best of my understanding there’s no work planned for this in the short term.

For more information about the HTTP JSON API query language, refer to [this page](https://docs.daml.com/2.0.0/json-api/search-query-language.html).

---

<div class="post-metadata">

**Author:** ![Stephen](https://yyz2.discourse-cdn.com/flex034/user_avatar/forum.canton.network/stephen/32/102_2.png) [@Stephen](https://forum.canton.network/u/Stephen)\
**Post date:** [March 7, 2022, 5:11pm UTC](https://forum.canton.network/t/can-you-do-partial-substring-text-matches-in-json-api-queries/4070/3 "2022-03-07T17:11:50Z")

</div>

Related (NB: this issue is not on a roadmap at this time, but it does little harm to 🔔 Subscribe to it):

> <https://github.com/digital-asset/daml/issues/6989>
>
> An \`%in\` operator would be useful for finding contracts against text fields wher…e there may be similar values. For example, I have contracts with "Alice", "Alicia", "Alison", "Alizia" ... and I want to find the one that I signed with "Aly".

> [@Partial Search in DAML](https://discuss.daml.com/t/partial-search-in-daml/2588):
>
> I went through the link :- [Query language — Daml SDK 1.12.0 documentation](https://docs.daml.com/json-api/search-query-language.html) and also did some research, but could not find how to do a partial query search in DAML. Example :- module ExampleModule where template Example with p : party text : Text where signatory p Now I created various contracts, for example with text field as “daml@da” Now, i want to retrieve that contract using partial search on endpoint - /v1/query with body as - { "templateIds": [ "ExampleModule:Example" …

---

<div class="post-metadata">

**Author:** ![stefanobaghino-da](https://yyz2.discourse-cdn.com/flex034/user_avatar/forum.canton.network/stefanobaghino-da/32/7057_2.png) [@stefanobaghino-da](https://forum.canton.network/u/stefanobaghino-da)\
**Post date:** [March 7, 2022, 5:13pm UTC](https://forum.canton.network/t/can-you-do-partial-substring-text-matches-in-json-api-queries/4070/4 "2022-03-07T17:13:38Z")

</div>

Thanks, Stephen. I linked this forum post on the ticket for future reference.
