AnsweredAssumed Answered

Repeat record counter in Survey123

Question asked by mitch.east86_GADNRWRD on Jul 12, 2018
Latest reply on Jul 12, 2018 by mitch.east86_GADNRWRD

I have a survey where field staff go to predetermined sites and collect multiple records. At each site, they collect information about up to 5 trees in each of 4 tree species groups. So, I created a survey where they record the date and stop #, then it has a nested repeat so they can collect multiple related records at a site (Stop# in image below).

 

I want to display a counter that tallies the # of trees recorded in each group so that a surveyor knows how many they have collected at that stop. There are four groups and each repeat tree record requires the surveyor to specify which group it belongs to. So, I have four hidden fields that (one for each tree group) that are populated with a 1 or 0 based on if the group is selected (Ex: int(if(selected(${treegroup},'whiteoak'),1,0))).

 

Right now I have a counter that uses the Calculate field in the form and the sum function that refers to the hidden fields described above. However, the sum function treats the hidden field data as text so instead of getting 1+1 = 2 or 1+0 = 1 it returns 1+1=11 or 1+0=10. How can I get this converted to an integer form? I've tried using the int() but that doesn't work.

 

The form is attached.

 

 

Attachments

Outcomes