Skip to content
Discussions/App Development/Can you do partial/substring Text matches in JSON API queries?Forum ↗

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

App Development4 posts583 views1 likesLast activity Mar 2022
ME
meetOP
Mar 2022

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?

ST
stefanobaghino-da
Mar 2022

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.

ST
Stephen
Mar 2022

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

github.com/digital-asset/daml

Add '%in' operator to JSON API query language.

opened 06:57PM - 04 Aug 20 UTC
component/json-api team/ledger-clients ledger clients facade

An `%in` operator would be useful for finding contracts against text fields wher

I went through the link :- Query language — Daml SDK 1.12.0 documentation 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" …
ST
stefanobaghino-da
Mar 2022

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

← Back to Discussions