Skip to main content
nicholasf4944
Participating Frequently
Nov 21, 2023 2:47 PM UTC
Solved

How to base64 encode string in expression

Hello,

How would I go about Base64 encoding a string inside of an expression?

In my use case, I have an input to a process model where parameters is a list of type map

I would like to wrap local!JOB_ID in a function that converts it to Base64.

processParameters: {
    parameters: {
        a!map("operationId": 210),
        a!map("jobId": local!JOB_ID),
    }
}

Thank you!

    mikes0011
    mikes0011Answer
    Brainy
    Nov 21, 2023 2:57 PM UTC

    It's possible (if complicated) to write a (text) Base64 encoder / decoder using an OOTB expression rule.

    The Expression Guru

    5 replies

    mikes0011
    mikes0011Answer
    Brainy
    Nov 21, 2023 2:57 PM UTC

    It's possible (if complicated) to write a (text) Base64 encoder / decoder using an OOTB expression rule.

    The Expression Guru
    nicholasf4944
    Participating Frequently
    Nov 27, 2023 3:09 PM UTC

    Hi Mike,

    Thank you for the response!
    Does Appian not support Base64 encoding out of the box without creating a custom encoder?

    If not, can you point me in the right direction as to some documentation related to this?

    Thank you,

    Nicholas

    mikes0011
    Brainy
    Nov 27, 2023 3:17 PM UTC
    Does Appian not support Base64 encoding out of the box

    Correct

    If not, can you point me in the right direction as to some documentation

    Is the Appian expression Rule i wrote in the linked thread above not sufficient for your use case for any reason?

    The Expression Guru