Automatically calculate filed value in odk build

it's working fine but in this xml not working properly.

22.xml (80.2 KB)

please see it.

Look at these two lines:

  <bind nodeset="/data/Worker_detail/worker_CNIC_details" type="select1" required="true()"/>

  <bind nodeset="/data/Worker_detail/worker_cnic" type="string" required="true()" relevant="(/data/worker_CNIC_details != 'Alien')" constraint="(regex(.,'^[0-9]{5}-[0-9]{7}-[0-9]{1}$'))"/>

if the path of worker_CNIC_details is /data/Worker_detail/worker_CNIC_details your expression below should be:
(/data/Worker_detail/worker_CNIC_details != 'Alien') not (/data/worker_CNIC_details != 'Alien')

as I said above, try to use xls instead otherwise it will be super difficult when you will need to create complex forms.

Thanks Grzesiek2010,

I really appreciate your guidance.Now,it's working fine.

I want to know and guide me that::

If Alien is selected then it's possible that automatically entered/filled word "Alien" in "worker_cnic" filed.


No it's not possible because we don't support dynamic default answers please read Assigning a dynamic default value to a text-type question
You can do something like described int this asnwer Assigning a dynamic default value to a text-type question

Thanks Xiphware.

I am very grateful to you.

YW. If you’ve found a satisfactory resolution please mark the thread as solved, thanks.