Repeat Function map and Picture and calculate

Hello,
I have two questions about

  1. for geopoint and picture:
    This function works very well, to give the user the possibillity to use it more than one time to create location and pictures. But the values will stored in another table not at the same csv table as the other questions. So is there another solution, similar like this, but with stored values in the normal csv table of the survey?
    I create it like this: first picture has a name, like "above", second picture like "below" and following other pictures with indefinite number should named as "detail" with consecutive number at the end. Saved in the same table with the first and second picture....

  2. calculate: I use this to calculate values of a range question (start=0;end=100;step=5) for a group of 8 questions like this: ${Schlamm} + ${Ton_Lehm} + ${Sand} + ${Kies} + ${Grobkies} + ${Steine} + ${Bloecke} + ${Torf} to get the summe_substrate.
    The summe_substrate shows the result only if all 8 questions will filled. Also if a question will zero it must be clicked to zero, for all and after all will be selected the result will be shown only.
    Is it possible to show the result after each question as an interim result?
    Thanks
    Maggi

For 2. you should add/use coalesce() function for each element of the sum not being mandatory, please. See documentation https://docs.getodk.org/form-logic/#empty-values-in-math.

Thank you, but I try it but it doesnot change the problem.... Maybe what I have done is not correct?
Feldprotokoll.xlsx (10.4 KB)

Thank you for your help

You need to use coalesce(${Schlamm}, 0) + coalesce(${Ton_Lehm}, 0) + ...

Or, as the coalesce() function works with strings, you might use string syntax and add an own cast to number, i.e. number( coalesce(${Schlamm}, '0') ) + number( coalesce(${Ton_Lehm}, '0') ). See coalesce function here: https://getodk.github.io/xforms-spec/#fn:coalesce and for range https://docs.getodk.org/form-question-types/#range-widgets.

See attached file, with different syntax examples, all working in Enketo, Online validator and ODK Collect. Feldprotokoll03.xlsx (9.8 KB)

Few further hints:

  • If your sum elements represent percentages, you should add a constraint to limit the sum to <= 100 (%).
  • As required false is the system default, you only need to define it if true.
  • The UI to remove a range value is different: In Collect you select the value above the range scale and remove it with the pop-up menu. In Enketo you use the circle sign below the range scale. (@LN, for your list of differences :raising_hand_man:)
1 Like

@ wroos Perfect thx......
Someone an idea about question 1?
Thank you for your help.

Hi @Maggi,

for this point maybe you should evaluate the value of an "indefinite number" of pictures :wink: . Let's say 10. You can then add 10 image questions to your form.
And before each question you can ask if the user want to add a pictures and is it in a relevant test (and for all following questions)

photo_inline_instead_of_repeat.xlsx (485,9 Ko)

1 Like

Thank you very much. it is perfect....

2 Likes