Forms due structure

Hi all,

In my study, I have three forms which consist of one that just needs to be filled in once, another that needs to be filled in once per day of survey, and then the actual survey that will be filled in multiple times per day of survey. Is there a way to set this up so it is clear to the sites what is due and when?

Many thanks,

Faran

Hi @faran_d

Could you elaborate on that, please? What kind of automation would you expect?

Hi @Grzesiek2010

I think the main thing is making sure that forms can only be filled out a specific number of times. E.g the first form can only be filled out once, and the second form is filled out once per day.

Kind regards,

Faran

It is possible but you can do that within the same device. For example to make sure only one form is saved per day you need:

  1. Add the end question so that when a form is saved the time of saving it is also saved.
  2. Calculate the current time using the now() function so that it is available whenever a new form is started.
  3. Compare the end time from the last saved form (using https://docs.getodk.org/form-logic/#values-from-the-last-saved-record with the current time (from the second point).

Thanks to that you can tell how many days ago the previously filled form was saved.
Here is a sample form:
one_form_per_day.xlsx (6.1 KB)

For the first scenario where you want to save only one form, it's even easier you can just check if the end time exists at all using https://docs.getodk.org/form-logic/#values-from-the-last-saved-record like in the form I prepared.

1 Like

Hi @Grzesiek2010

Thank you for response - that's really helpful and has worked as it should.

I want to ask if there is a way to make this rule dependent on the value of a field within the form?

Let me explain:

The first field in the form is 'facility code'. Each facility should only fill this form in once a day, however the same device may be used for a number of facilities. Is it possible to therefore make this rule dependent on the facility code field? If a form has already been entered with that facility code, then they will not be able to enter another with the same facility code until the next day.

Many thanks,

Faran

This is not doable because there is no way to check what codes were already used. We can only check the last used code thanks to Values from the last saved record and block a user if both forms have the same code but it's only the value from the previous form.