Dear Community, @Gassim, is there a way skip logic can be applied in data sets while entering data? or this is only available on tracker program? another option would be to apply data validation rules, however I wonder if there is a way to validate qualitative data in data set,
Here I mean let for example say that number of students with disabilities will be entered only when the respondent says they have some,
ex: Question 1: do you have students with disabilities at this school?(Yes/NO) Question 2: if yes how many? (Number)
Hi @Pacifique_Hategekima,
When creating a dataset you will need to create a custom form and use JavaScript yourself to control these options because unfortunately, the skip logic and ‘program rules’ are only available in tracker not aggregate, but I saw suggestions in the community to use the tracker anyway!
I wanted to create a JavaScript for you and the community to help with getting started but unfortunately it still needs correction but here’s an example (needs correction so anyone feel free to correct it, thanks!):
It looks likes this:
<table>
<tbody>
<tr>
<th>Test</th>
</tr>
<tr>
<td id="underfive"><input id="dataElementID" name="entryfield" title="Inpatient cases Under 5 years" value="[ Inpatient cases Under 5 years ]" /></td>
</tr>
<tr>
<td><input id="fiveAboveDataElement" name="entryfield" title="Inpatient cases 5 years and above" value="[ Inpatient cases 5 years and above ]" /></td>
</tr>
</tbody>
</table>
<script>
document.querySelector("#underfive").firstChild.value.onchange = function(){
if(document.querySelector("#underfive").firstChild.value == 0)
{ document.querySelector("#underfive").style.display = "none";}
}
</script>
@Pacifique_Hategekima,
I worked again on the script above and the following one should work, but I need to tell you that this is at least to demonstrate an idea that will require a lot of work, here’s why? I used css style to hide the fields but then if you change the period to another period the same fields will remian hidden even if they are empty and will require you to refresh! The other issue in question is that this will not work on the android app. Maybe someone with advanced Javascripts skills would be able to solve some of these challenges but it seems that if you really need skip logic, you might want to use it on tracker.