Hi,
How can I get one or more summary notes with data from a repeat question, when the number of repeats is not known beforehand? In the attached form I'm creating the notes and then show them depending on the count
of the repeat. But with this approach I basically have to set a maximum number of repeats that will be shown in the summary. Is there a way to show all the summaries independent of number of repeats?
Additional questions:
-
What is the best way to have newlines in notes that works for both Collect and Enketo? In the documents I see I can use markdown, and this StackOverflow question shows different ways of having newlines in markdown. But I haven't found one way that works consistently for both collect and enketo. Using
<br />
works for collect, using 2 spaces and then 2 newlines works for enketo, but gives an extra newline in collect. (screenshots below) -
Is it possible to use
instance()
to get the data from a repeat? @LN you showed me how to useinstance
instead ofpulldata
so that I can use it directly in thelabel
of thenote
, is something similar possible with repeats? -
I can upload and use the form in Kobo, but ODK Central version v2023.5.1 gives me an error:
The XLSForm could not be converted: ODK Validate Errors:
>> Something broke the parser. See above for a hint.
Error evaluating field 'pn1' (${pn1}[1]): error in evaluation of xpath function [choice-name] => java.lang.NullPointerException[null]
Caused by: org.javarosa.core.log.WrappedException: error in evaluation of xpath function [choice-name] => java.lang.NullPointerException[null]
... 10 more
The following files failed validation:
${Hydrophonic} Control Sheet.xml
Result: Invalid
Hydrophonic Control Sheet.xlsx (451.1 KB)
Screenshots using Notepad++ to show the newlines and spaces:
Using <br/>
and having one single line in the cell show correctly in Collect but shows the <br/>
tag in enketo:
To show correctly in enketo I have to use 2 spaces and 2 newlines
But then it shows an extra newline in collect:
In the xlsform I've tested other options for newlines, but it seems that I'll have to go with the option of showing correctly in Enketo and have an extra newline in Collect, unless I use the deviceid to check if the form is using collect or not, to show one note or the other.