Skip to main content
nicholasf4944
Participating Frequently
November 21, 2023
Solved

How to base64 encode string in expression

  • November 21, 2023
  • 5 replies
  • 0 views

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!

    Best answer by mikes0011

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

    5 replies

    mikes0011
    mikes0011Answer
    Brainy
    November 21, 2023

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

    nicholasf4944
    Participating Frequently
    November 27, 2023

    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
    November 27, 2023
    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?