How do you decode a base64 field?

Jaime
edited March 1, 2017 in Questions
I have a salesforce field of base64 type that I need to decode?  How would I do that in a custom renderer?

thanks

Comments

  • Ben Hubbard
    edited March 1, 2017
    I think bota and atob would be the functions you would want to decode and encode base 64 strings in javascript. https://developer.mozilla.org/en-US/docs/Web/API/WindowBase64/Base64_encoding_and_decoding
  • jili@heidrick.com
    edited January 18, 2017
    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);
    skuid.ui.fieldRenderers['TEXTAREA'][field.mode](field,text);

    In the custom render for the content field in a field editor:
    value1 = arguments[1];
    text = window.btoa(value1);
    skuid.ui.fieldRenderers['TEXTAREA'][field.mode](field,text);

    The value displays as
    W29iamVjdCBPYmplY3Rd

    Do you have an example for custom rendering base64 field?

    Thanks.

  • @Jaime were you able to decode base64 field?
  • Germany3
    Germany3 🛠️ 

    @Mohnish can you share an example of the base64 field you are trying to decode?

  • @Germany3 Content field on Content Note object.

  • Thanks @Rob Hatch I will try it out.

  • Germany3
    Germany3 🛠️ 

    Hey, @Mohnish, just wanted to follow up. Any luck?


    Thanks,

  • Thanks @Rob Hatch. Worked perfectly.

    @Germany3 was able to get it working.

Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!