Hi all.
I'm building a vegetation sampling datasheet with repeats for each species encountered. I want to have a running summary at the bottom listing the species observed, but the problem is that I have two different species name fields I need to have combined into the list. I have one field that is a select_one dropdown with known species {herb_sp}, and I have a second text field for the observer to type in unknown species nicknames or a species not found on the list {herb_sp_other}. There will always be data inputted in one - but not both - fields.
In a hidden field within the repeat, I have this line {herb_sp_string} in calculate:
concat(concat(once(count(${herb_sp})), ": ", ${herb_sp},${herb_sp_other}, " | ", ${herb_cover_percent}),"%")
And in a note outside the repeat, I have
join("\n", ${herb_sp_string})
How do I add {herb_sp_other} so that unknowns are continuously counted along with knowns?
Have you considered using the list with an other option? Put an 'other' option in the list in your first question, add an Other question relevant on answering 'other' in the first question. Then in a third hidden question, use an if statement to combine the two.
name: ${herb_combine} calc = If (selected(${herb_sp}), 'Other', ${herb_sp_other}, ${herb_sp}) Then you just have to use ${herb_combine} in your summary calcs.
I'm am sure it can be done the other ways, like you are doing, but those calcs get really complicated with helper fields etc.
That worked, thank you!