Option set default value

hello community,

it is possible to have a data element associated to option set and we have a default selected option ?? in data set and program

There are ways to accomplish this, but definitely will want you to test out on your version of capture/android to make sure its behaving correctly and consistently. Assign value is what you want to do, but then you need to be able to have this not read-only (if the assign value action is still “firing”, it will not allow you to edit it). What we have done in the past is to create a program rule with a condition of !d2:hasValue(#{xx}) and assign value action of the option to your dataElement. What this should do is immediately assign and then “release” the dataElement once a value (which you have just assigned) exists.

1 Like

Yes, this is the way to assign default value