Is there a way to search by keyword within data extracts when using TxnQuery, similar to what is allowed with several of the SubmissionDao get methods? My use case is to find saved submissions that have a specific date of birth, which is in the data extracts.
Currently the TxnQuery class does not support this type of search.
Thinking about how we could implement this and the API design, are you just searching for one particular data extract value. e.g
new TxnQuery() .setFormStatus(Txn.FORM_SAVED) .setDataExtract("Date of Birth", "1970-01-01") .listValues()
Yes, that is how I would like to use it. My current solution is using the WorkspaceDao class and it's search criteria with a non-fluent service.
With that it's just keyword search within extracts, so no opportunity to indicate that search is for 'Date of Birth" but rather just all data extracts - but it works. The granularity that you are proposing above would be an improvement.
You could also consider a version of setDataExtract() that takes a Map<String,String> so that more than one extract name/value pair could be submitted.
Sorry for the late reply - I didn't have alerts set on these replies!
has this been implemented in TM 5.1.10?
We have a form that stores some key information from the form in a single data extract field that we use to check whether a submission with duplicate data has been made. So each time a submission is made we check all previous submissions extract data for this one field to determine whether this represents a duplicate because it will have the same value. We had previously implemented this (unwisely perhaps) as a database query. How would we use this type of query to solve that problem?
Hi Matthew White
Unfortunately, this feature has not been implemented in 5.1.10 but we have raised it as a feature request for the next major release.
In the meantime, we found this article which may be helpful to your situation.
Creating and Presenting Custom Reports
thanks for the article, I've learned from it but unfortunately it doesn't demonstrate a mechanism for querying data extracts efficiently. You could pull in the extracts from each submission and test them but that would be slow. I should be able to compare the hashes of the data extracts for each submission if I can work out how they are hashed or work out how to get the hash value of the field I'm interested in.