Jump to content
  • 0

Base64 Encode in SQL Table



Hello, All,

I'm doing a bunch of work with images that reside at different URLs and sometimes I need to pass them as query parameters or as part of query strings.  I find Javascript a poor solution because it needs to be repeated in many places and is difficult to maintain (and my Javascript skills are poor).  I'd like to be able to store the URLs in a table and let SQL do the heavy lifting.  I've currently got a table with 3 fields:

  1. Image Standard URL
  2. Image URL for Passing (using nested SQL Replace to eliminate characters that can't be passed)
  3. Image URL b64

I'd like #2 and #3 to be formulas off of field #1.  #2 works great.  #3 - It looks like Caspio won't let me use standard MS SQL functionality:  BASE64_ENCODE (expression [, url_safe]) / see this link. It seems surprising that Caspio wouldn't support this.  Has anyone wrestled with / resolved this?  I guess I could do it at one time in Javascript on the page where field 1 is set, it just seems like this shouldn't be so difficult?


Link to comment
Share on other sites

2 answers to this question

Recommended Posts

  • 0

Thanks, @PotatoMato.  The URLs I'm trying to encode can be quite long, so I'm trying to do a base64 conversion rather than a string replacement.  I am able to do it in Javascript one place where I need it, but I also need to generate records on the many side of a 1:n relationship, where each  of the many needs to have an encoded URL.  I can't seem to do it in tasks, triggers, or formula fields.  I will probably do it via Zapier if I can't find a way inside Caspio, but it seems like a complex solution to a simple problem.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Create New...