Upland OL User community

Convert base64 in Designer

Our customer delivers a database with a very long Base64 string. Online I can convert 1 number into an image (with a personalised QR), but since the database has more than 3000 unique strings: how do i dynamicly convert this in Designer?

Hi @RolfVermolen,

Can you let us know please in what kind of images these are? Are these PNG or JPG images for example?

Hi @Marten These are PNG-images.

Hi @RolfVermolen looking athe docs, you can set the src attribute as your variable data field (the base-64 string):




@RolfVermolen, thank you for letting us know.

@AlexRobinson1481, that’s it indeed.

Let’s say that you have a record field called base64string to which the Base64 string has been assigned to. In this case you might consider to use some like this to achieve this:

<span id="placeholder-base64string">@placeholder-base64string@</span>

Standard Script:

Name: Example
Selector #placeholder-base64string
JavaScript code:

var field = "";
var result = "";

field = record.fields.base64string;

if (field !== "") {
    result = "<img src=\"data:image/png;base64," + field + "\">";

1 Like

Thanks @marten and @AlexRobinson1481, this puts me on the right track (I was this close:D)!