Custom Logic in Mandatory Response

Hi Team,
Good Morning!
This is regarding the Custom Logic.Find the below image for the reference.

image

Could you please let us know what is the logic behind the Custom Logic in Mandatory Response and the use of Custom Logic in forms.

Regards,
Keerthi.

1 Like

Hi @adepuk,

It’s not always that you wish to see your variables mandatory (where the variable should be filled, else the filled-up form would not get submitted to the KoBoToolbox server) or optional (where the variable could be left blank and the filled-up form could still be submitted to the KoBoToolbox server). You might sometimes wish to make it mandatory for certain criteria.

It is a form of a mandatory response if and only if it meets a certain criteria else it would act as an optional response. You could define the required criteria in the text space of the Custom logic.

For further understanding please have a look at the images shared below:

In the survey tab of your xlsform:
Image 1

In the choices tab of your xlsform:
Image 2

Data entry screen as seen in Enketo:

Data entry screen as seen in Enketo:

Reference xlsform:
Custom Logic (Mandatory Response).xlsx (10.4 KB)

Have a great day!

1 Like

Hello
I do not understand well custom logic with that example. I still do not see the difference between optional and custom logic, do you have another example?
Thank you
Aline

Hi @alinephilibert,

Would you mind trying out the workaround (shared with the post). Try entering a dummy response from the same and you should be able to have a picture of what a mandatory response is and what a custom logic is.

Also please feel free to have a look with one of our other discussion related to custom logic (it should be helpful for you):

Have a great day!

1 Like