Is it possible to query entries by date? #1526
Replies: 1 comment
-
|
OK, so it looks like what we're after is possible by using an IFormRecordSearcher (found it by disassembling the Forms DLLs). That appears to be what the back office uses, and seems much more performant than IRecordReaderService (if you want to do something like get the last 24 hours of entries for example). Querying form data by date etc isn't that uncommon a thing to want to do I don't think. We should either document the IFormRecordSearcher interface, or maybe add the ability to filter/sort to the IRecordReaderService. It's also worth noting that the IRecordReaderService doesn't have a way of fetching an individual form entry either, you have to use another service to do that. Use case here would be wanting to pull form fields from their submission out onto the thank you page for example. It looks like you can use the IRecordStorage interface to get the individual record, but again, it's not mentioned in the docs (and there may be another better way of fetching an individual record that I've not found yet). |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Which Umbraco Forms version are you using? (Please write the exact version, example: 13.4.0)
13.x
Which Umbraco version are you using? (Please write the exact version, example: 13.5.2)
13.x
Issue summary
I'm trying to query form entries by date range. I can't find a way to do it using the documented methods though. The entries viewer in the CMS allows you to query by date though, so it must be possible somehow.
Specifics
No response
Steps to reproduce
In the CMS, when viewing the form entries, you have the option to query by date range.
All the documented record service methods query by all records for a form/page though. Is there a way to query by date as well, so you don't have to fetch every single record just to check the last 24 hours worth?
Performance wise, using the IRecordReaderService seems VERY slow. Getting 22,000 records adds over a minute to the processing time of a workflow where we're querying against the entries. All we need is to get the last couple of hours worth of entries so that we can check for duplicates. The entry view in the CMS is super snappy, but there's nothing documented that tells us how we might replicate that.
Expected result / actual result
No response
Beta Was this translation helpful? Give feedback.
All reactions