Line breaks, empty lines, and <br/> tags in html_notes rich text?

We are using Zapier to create new tasks in Asana. Using Zapier own “Create task” action, we have been adding rich text to the task description for a while now. This rich text included
tags to force line breaks in certain areas. However, it seems this all of a sudden stopped working last night, and is causing an XML error.

In particular it’s getting a 400 response.

{
  "errors": [{
    "error": "xml_parsing_error",
    "message": "XML is invalid",
    "help": "For more information on API status codes and how to handle them, read the docs on errors: https://developers.asana.com/docs/errors"
  }]
}

As soon as I remove the
it works fine.

Here is what Zapier’s logs showed: https://i.imgur.com/2IO4lCI.png

So, has anything changed within the last day regarding the rich text? I see the documentation doesn’t mention
anywhere: Rich text

But how else can we create multiple line breaks then? The HTML characters don’t seem to do anything within the Zapier Asana “description” field, since it’s apparently XML. It just outputs them as text when it gets sent to Asana (rather than making them line breaks):

  • \u200b
  • \n\u200b\n
  • \n\n
  • \n

Asana is rolling out a new format of rich text, perhaps it just hit your account yesterday?

We’ve had that functionality in our Asana account for a month now. But maybe, somehow Zapier has just become affected? Either way, I don’t see how to create an empty line break currently with Zapier’s integration then. :frowning:

hey @FreshyJon, there has been a rollout of new behavior for html_notes, and it seems like the Zapier integration has finally been included in the rollout. The <br/> tag is no longer supported, so removing that should fix this up. Instead, you should use a \n\n. However, stay tuned as we’ll be refining this behavior shortly due.

Thanks for the info. Unfortunately typing \n\n into their description box in Zapier just renders it as \n\n rather than it outputting a line break.

1 Like

Did you find a solution to this @FreshyJon ? Not seeing anything related to line breaks in the Rich text article.

Line break is \n

If it’s not working right in Zapier per @FreshyJon, perhaps it’s a Zapier issue?

Thanks, @Phil_Seeman ! I’m quite new to string manipulation so thank you for your responses as I’m sure this is quite elementary.

I’m using the Update a task reference to test this out before going back into Zapier.

I’m starting with a source field that starts like this:

Single Line
Line after soft return

Line after paragraph

I’m encoding into this format for the html_notes field:

<body>Single Line\\nLine after soft return\\n\\nLine after paragraph</body>

Which results in the CURL Request:

"html_notes": "<body>Single Line\\nLine after soft return\\n\\nLine after paragraph</body>"

And I’m getting a successful response:

"notes": "Single Line\\nLine after soft return\\n\\nLine after paragraph",

But it’s resulting in this:
Screenshot 2023-08-03 at 2.00.54 PM

Hmmm, you shouldn’t need the double backslash - what happens if it’s just \n and not \n ?

Hey @Adam_Ennis ,
In case it helps any, I was able to add a new line to text in the Zapier ‘Create Task’ Description field by pasting in a Zero-Width Space unicode character that I copied to my clipboard.
(Copied from here: ​ U+200B ZERO WIDTH SPACE - Unicode Explorer)

Thanks @KMcMorrow. @Phil_Seeman was quite right. I had been using the updatetask API reference to try out various code updates, but the \n was being interpreted in my sync tests as two literal characters: "\n"

However, I went and ahead and just coded the JSON in the Zapier Webhooks Integration and it worked flawlessly. Relied too much on the dev test rather than just go for it.

I will keep that ZWS in my back pocket for the future, tho! Thank you!

1 Like