Multi-Line Text

Options
Hi there,

I tried and search the web and community, but couldn't find an answer. Is it possible to store multi-line text data into Xano. How should I do this? I tried using \n but that doesn't work as expexted.

Comments

  • Ray Deck
    Ray Deck Trusted Xano Expert ✭✭✭
    Options
    What is the behavior you are experiencing that is not what you expected? Can you share screenshots?

    For context, text is just a sequence of characters in the database, with no real consideration for "lines" per se. Which both means the presentation might not be beautiful but also that you should be able to retrieve exactly what you sent.

    But multiline text can be tricky for a bunch of reasons. For example, in a web browser there is no real treatment for newline characters so it all looks like a stream coming across unless you do some specific preprocessing. That's why I ask about the details of your situation - might be able to point you in the right direction! 
  • FJP H
    FJP H Member
    Options
    Thanks for your reply. I understand what you are saying. The use case came up when I was trying out pdfmonkey to generate a pdf. In pdfmonkey I use a standard example template. An example JSON payload was provided to test the template and there was something like:

    "Address":"streetname housenumber\nzipcode city"

    In pdfmonkey the template uses the liquid "newline_to_br" to transform the '\n' to a
    .

    I tried to generate the json as a response in Xano to be able to call the pdf generation service with this json payload.

    But the '\n' was interpreted a text an not as a newline character. The liquid function was not working.

    I solved this by just splitting the address in separate properties, and changing the template in pdfmonkey accordingly.

    Another use case could be that data is stored from a frontend WYSIWG input, but I suppose that the content of that field is stored in Xano with html markup, that when shown in the frontend can be parsed/rendered in correct format. Am I right?