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"
}]
}
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):
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.
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.
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!
The issue you’re encountering with the <br> tags causing XML parsing errors in Zapier’s “Create Task” action for Asana likely stems from a recent update or stricter XML validation in the Asana API. Since the documentation doesn’t explicitly support HTML tags in descriptions, a different approach is needed for line breaks.
Solution: Use Markdown for Line Breaks
Asana supports Markdown for formatting task descriptions. To create multiple line breaks, you can use double spaces followed by a newline (\n) to insert a line break in Markdown. Here’s how you can structure the text in your Zapier action:
Single Line Break: Use two spaces followed by \n
Multiple Line Breaks: Repeat the two spaces followed by \n as needed
Example
Instead of using <br>, format your description like this:
Line one with some text
Line two with a line break after the first line
Line three with two line breaks above
In your Zapier setup, the description field should look like:
Line one with some text \nLine two with a line break after the first line \n\nLine three with two line breaks above
Steps to Update Your Zap
1. Edit the Zap: Open your Zap that creates the Asana task.
2. Modify the Description Field: Replace any `<br>` tags with the appropriate Markdown syntax for line breaks as shown above.
3. Test the Zap: Run a test to ensure the description appears correctly formatted in Asana.
By using Markdown for line breaks, you should avoid the XML parsing error and have your task descriptions formatted correctly in Asana.
Still no luck here. For a while, Zapier’s “Create task” action was allowing real HTML to be able to use <body> tags and actual <strong>, <hr>, and <h1> tags to output HTML descriptions.
But now that action is using a “Legacy” version of the Asana integration. The newer version of the Zapier Asana integration once again requires XML via markdown syntax for “rich text”. But I can’t figure out how to get line breaks to work there.