This website uses Cookies. Click Accept to agree to our website's cookie use as described in our Privacy Policy. Click Preferences to customize your cookie settings.
You are right, we can use your script approach but sometimes one needs to generate an encoded string on the fly and that is why I added the feature request.
This would be a very helpful feature for sending images to services outside of AppSheet. With the number of Image AI’s growing, I think this feature will only get more necessary in the future
@Bellave_Jayaram, I know you’re looking for a method that avoids Apps Script, but what if the script is just to declare a custom function? Then you can apply the script via sheet formula, instead of having to invoke the script from AppSheet.
Apps Script
Summary
/**
* Convert input string to Base64Encoded.
*
* @param {string} The input cell.
* @return {string} The encoded string.
* @customfunction
*/
function base64Encode(input) {
if (input != ''){
return Utilities.base64Encode(input.toString(), Utilities.Charset.UTF_8);
}
}
/**
* Convert base64Encoded input string to decoded string.
*
* @param {string} The input cell.
* @return {string} The decoded string.
* @customfunction
*/
function base64Decode(input) {
if (input != ''){
return Utilities.base64Decode(input, Utilities.Charset.UTF_8).toString();
}
}