Conditional line break (in if(...))

More
3 years 4 months ago #101697 by jonsen
Hi everyone,

does anybody know if it is possible to use a line break in a formula? I need to do if(X==Y,"","\n\n\n"). This is for an email invitation. As I use plain text, I cannot use html like <br /> or similar...

Is it possible?

Thank you very much!

Best
jonsen

Please Log in to join the conversation.

More
3 years 4 months ago - 3 years 4 months ago #101767 by jonsen
Okay, so I switched to HTML and used <p>{if(...)}</p>, which actually doesn't produce a new paragraph if there isn't anything in there. This wasn't really what I wanted (which was to stay text-only), but there was no other way...

There seems to be no solution with the break within the formula. "\n" doesn't work, having an actual line break "
" doesn't work, and what I found most annoying, even "<br />" and "<p>" don't work because the editor automatically adds line breaks to format the source code, which then breaks the formula (in which line breaks are obviously not allowed).

So, how about adding support for \n, \t and all the fun stuff?

Best
Jonsen
Last Edit: 3 years 4 months ago by jonsen. Reason: correct typos

Please Log in to join the conversation.

More
3 years 4 months ago #101772 by tpartner

Cheers,
Tony Partner

Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.

Please Log in to join the conversation.

More
3 years 4 months ago #101787 by DenisChenu
Hi,

I don't know for \n BUT the easiest way to update Equation is to use "HTML editor popup" and not inline.
manual.limesurvey.org/First_login_-_Your_user_preferences#Popup

Denis

Assistance on LimeSurvey forum and LimeSurvey core development are on my free time.
I'm not a LimeSurvey GmbH member, professional service on demand (or search sondages pro).
The following user(s) said Thank You: jonsen

Please Log in to join the conversation.

More
3 years 4 months ago #101816 by jonsen
Thanks tpartner and Denis! Using <br /> works with the popup editor!

I don't think a feature request is neccessary. I guess the cases in which users actually want to work with \n are too rare. Tell me if you think otherwise.

Best
Jonsen

Please Log in to join the conversation.