Filtering ODK Submissions in the URL using today function

1. What is the issue? Please be detailed.

I want to be able to send a URL of the submissions in Central to only show Today's submissions. Something like Today() in the URL would be great but I cant get it to work.

2. What steps can we take to reproduce this issue?
As above

3. What have you tried to fix the issue?

4. Upload any forms or screenshots you can share publicly below.

I am not aware of a way to format a static URL that defaults the filter to the current date.

Note: Time zones can make this sort of thing very tricky, especially if the website is loaded in a different time zone than the data collection. Do you want submission for "today" where the website is loaded, or where the forms were filled out?

By default, the most recent submissions will be first in the list when you load a project's submissions page.

You can load the submissions for a specific date(s) using a URL formatted with this structure:
https://myCentralServer.example/#/projects/9/forms/myProjectName/submissions?start=2023-11-07&end=2023-11-07

If using the OData service data document you can use the $filter querystring parameter.

Central only allows filtering by start and end dates at the moment. Having the active filters (of date range, submitter, review state) show up in the URL at all is relatively new (within the last year) so it is not as flexible as it could be.

Under the hood, the Central frontend uses the backend OData API, which does support such a filter. That filter might look like:

.../myForm.svc/Submissions?$filter=day(__system/submissionDate) eq day(now())

There is a bit more documentation about the supported odata filters here that Dan also linked above. It could be nice for Central to be able to pass through more complex odata filters from the URL.

1 Like