Select to view content in your preferred language

Survey123 Javascript Functions

201
0
03-20-2023 01:26 PM
KyleBurford
New Contributor II

Hi all,

I am using Survey123 Connect and specifically using a JS function to generate outputs based on plugging user inputs into a formula. That all works fine but the issue I've come across is with how the results are returned to the field app.

This works as expected:

return '<ul><li>' + year1 + '</li><li>' + year2 + '</li><li>' + year3 + '</li></ul>'

This is output as a bulleted list.

This does not work as expected:

return '<table><tr><td>' + year1 + '</td></tr><tr><td>' + year2 + '</td></tr><tr><td>' + year3 + '</td></tr></table>'

Instead, it is returned as single row.

I would prefer to return the results as a table but am not sure why the list works but not table.

Any ideas or suggestions will be appreciated. Hopefully I'm missing something obvious 🙂

Thank you!

Kyle

0 Kudos
0 Replies