How do you decode a base64 field?

  • 1
  • Question
  • Updated 2 years ago
I have a salesforce field of base64 type that I need to decode?  How would I do that in a custom renderer?

Photo of Jaime


  • 1,220 Points 1k badge 2x thumb

Posted 3 years ago

  • 1
Photo of Ben Hubbard

Ben Hubbard, Employee

  • 12,550 Points 10k badge 2x thumb
I think bota and atob would be the functions you would want to decode and encode base 64 strings in javascript.
Photo of

  • 2,042 Points 2k badge 2x thumb
Hi I'm trying to use the new contentnote object. In the custom render for the content field in a list view:
value1 = arguments[1];
text = window.atob(value1);

In the custom render for the content field in a field editor:
value1 = arguments[1];
text = window.btoa(value1);

The value displays as

Do you have an example for custom rendering base64 field?