[Solved] Bug in {{encodeBase64 val}}?

Hi there,

I have defined in my workflow a mutate element, that works in 2 steps:

  1. it “strignifies” the data.query object
  2. it encodes in Base 64 the stringified value obtained from 1

I noticed that the base64 encoding systematically appends 2x &#x3D at the end of the string, making it unreadable in my application.

Are you aware of any bug or limitation ?

Are you using two curly braces - {{ - or three curly braces - {{{ around your encodeBase64 call? Handlebars html escapes content when using two curly braces (http://handlebarsjs.com/#html-escaping), and so the ‘=’ signs at the end of base64 values are probably getting html escaped. You probably want to use the triple curly braces, to bypass the html escaping.

Inded, I was using 2 curly braces - using 3 fixes the issue :slight_smile:
Thanks,

Glad that was it! :slight_smile:

Indeed :slight_smile: . And for future references, I had to use 3 curly braces at two places:

  • at the mutate block level: {{{encodeBase64 data.query.myfield}}}
  • but also at the subsequent http POST block: { "Data": "{{{data.query.encoded_query}}}", }