Prevent NULL in repeat group

Status
Not open for further replies.

karlis

Member
Hello! I have some a repeat group in a form I'm having problems with.
The form is for Persons and the repeat group is Person_responsibility. Person_responsibility is a list that contains Person_id, Responsibility_id.
My problem is such -- not everyone in the db has a responsibility in the secretariat, and when editing a person's record, who has no responsibility in the secretariat, a NULL record is stored in Person_responsibility.
Is there a way to prevent this?
The group for secretariat responsibility is hidden by a yes/no field. Bet regardless, every person who gets edited gets a NULL record (unless they already have a responsibility, as in the screenshot).
 

Attachments

  • cilveki.png
    cilveki.png
    138.7 KB · Views: 23
  • sekretariats.png
    sekretariats.png
    120.6 KB · Views: 22
Yup. If you don't, and the repeat group renders an instance in the new form, when the form submits, we have no way of knowing if it's "null" or not. It's just a repeat group with one repeat, that has its default values.

The only way to avoid that is to set min repeats to 0, so there's no instance of the repeat rendered when the form loads, and if the user wants to add one, they add one.

-- hugh
 
Status
Not open for further replies.
We are in need of some funding.
More details.

Thank you.

Members online

Back
Top