Issue with Line Breaks in KoboToolbox Form

Hello Kobo Support Team,

I am experiencing an issue in a KoboToolbox form.

I am trying to display a list of medicines with their quantities, each on a separate line, using a formula like:

concat(${c1}, ' : ', ${Drug_quantity}, '\n')

However, instead of showing each medicine on a new line, all entries appear on the same line in the output.

I have tried using \n, concat, and join, but the line breaks are not applied as expected.

Could you please advise the correct way to display multiple lines in a single field in KoboToolbox?

Thank you for your support.

Are you using Collect or Enketo? Could you share a related short extract of your form, please? What types are these referenced variables (repeats)?

As work-around, you might try to put a character before and after the line break, e.g. “.”. (To block stripping of leadng/trailing space elements.)

You can accomplish this - that is, generating multi-line labels - in KoboCollect, using a
line break in a multi-line label; either manually entering it in the label string or inserting it via a calculated label. This form shows a few permutations:

multiline_label.xlsx (46.8 KB)

The output for each of these will look like:

You probably want something more like the last one, where the label is programmatically constructed with a calculation:

Unfortunately, this only work in KoboCollect; Enketo has more limited support for markdown, and AFAIK there’s no way to readily accomplish the same; eg my same form in Enketo produces:


as you can see, all the line breaks are ignored :face_with_diagonal_mouth:

2 Likes