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

**URL:** <https://forums.losant.com/t/solved-bug-in-encodebase64-val/414>\
**Category:** Help\
**Created:** [February 20, 2017, 4:43pm UTC](https://forums.losant.com/t/solved-bug-in-encodebase64-val/414 "2017-02-20T16:43:52Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Sebastien\_Fouss](https://avatars.discourse-cdn.com/v4/letter/s/c0e974/32.png) [@Sebastien\_Fouss](https://forums.losant.com/u/Sebastien_Fouss)\
**Post date:** [February 20, 2017, 4:43pm UTC](https://forums.losant.com/t/solved-bug-in-encodebase64-val/414/1 "2017-02-20T16:43:52Z")

</div>

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 ?

---

<div class="post-metadata">

**Author:** ![Michael\_Kuehl](https://sea1.discourse-cdn.com/flex015/user_avatar/forums.losant.com/michael_kuehl/32/99_2.png) [@Michael\_Kuehl](https://forums.losant.com/u/Michael_Kuehl)\
**Post date:** [February 20, 2017, 5:00pm UTC](https://forums.losant.com/t/solved-bug-in-encodebase64-val/414/2 "2017-02-20T17:00:33Z")

</div>

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](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.

---

<div class="post-metadata">

**Author:** ![Sebastien\_Fouss](https://avatars.discourse-cdn.com/v4/letter/s/c0e974/32.png) [@Sebastien\_Fouss](https://forums.losant.com/u/Sebastien_Fouss)\
**Post date:** [February 20, 2017, 5:47pm UTC](https://forums.losant.com/t/solved-bug-in-encodebase64-val/414/3 "2017-02-20T17:47:51Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Michael\_Kuehl](https://sea1.discourse-cdn.com/flex015/user_avatar/forums.losant.com/michael_kuehl/32/99_2.png) [@Michael\_Kuehl](https://forums.losant.com/u/Michael_Kuehl)\
**Post date:** [February 20, 2017, 6:03pm UTC](https://forums.losant.com/t/solved-bug-in-encodebase64-val/414/4 "2017-02-20T18:03:38Z")

</div>

Glad that was it! 🙂

---

<div class="post-metadata">

**Author:** ![Sebastien\_Fouss](https://avatars.discourse-cdn.com/v4/letter/s/c0e974/32.png) [@Sebastien\_Fouss](https://forums.losant.com/u/Sebastien_Fouss)\
**Post date:** [February 20, 2017, 6:19pm UTC](https://forums.losant.com/t/solved-bug-in-encodebase64-val/414/5 "2017-02-20T18:19:05Z")

</div>

Indeed 🙂 . 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}}}", }`
