Getting 400 error while updating confluence page

I am trying to fetch data from csv file and update confluence page using data like below, if I am using colour coding to indicate UP or DOWN its not working. Else its working fine.

Name Count Status
Samsung 121

UP ↑

Nokia 132

DOWN ↓

Asus 187

UP ↑

karbon 145

DOWN ↓

code:

content==$(awk -F',' 'BEGIN{ print "print "<tr><th>Name</th><th>count</th><th>Status</th></tr>"}
           { print "<tr><td>" $1 "</td><td>" $2 "</td><td>" $3 "</td></tr>" } 
           END{ print "</table>"}' input.csv | tr -d "[:space:]")

Error:

"statusCode":400,“data”:{“authorized”:false,“valid”:true,“allowedInReadOnlyMode”:true,“errors”:[],“successful”:false},“message”:“Error parsing xhtml: Unexpected character ‘’’=’’’ (code 61) excepted space, or ‘’’>’’’ or “/>”\n at [row,col {unknown-source}]: [1,632]”,“reason”:“Bad Request”} 

Thanks,
Dastagiri

Hi @Dastagiri ,

This looks related to this post. Based on the error you’re getting, I recommend checking the value of content as it could be malformed.

Based on this code, since you are using two ==, you’ll have a preceding = for content something like this

=<table><tr><th>Name</th><th>Bounce</th><th>Department</th></tr><tr><td>one</td><td>two</td><td>three</td></tr><tr><td>foo</td><td>bar</td><td>baz</td></tr></table>

The preceding = might explain your error

Error parsing xhtml: Unexpected character ‘’’=’’’ (code 61)

Cheers,
Ian

1 Like