Skip to main content
sarathkumr268295
May 19, 2023
Question

Convert document to base64 string

  • May 19, 2023
  • 11 replies
  • 0 views

Hi all,

We need to send a document from appian to an external system which receives document as a part of json with document converted into base64 string. 
For example:
{

"name":"Document_name",

"document":"base64 string encoded document"
}

The request json will look something like this. How to convert document into base64 string in appian? Do we have any plugins for that??

11 replies

sunilc6392
May 19, 2023
sarathkumr268295
May 19, 2023

I tried using 1st method, we had error like file too complex from the integration response. So not sure if this is the way to do it. 
its saying to use todocument() which is returning the document name. The external system needs the document in base64 string.

the base64 string should look something like this : "VGVzdCBkb2N1bWVudCA3ODM0dGhxaXJ1aXJnaFdSTEdKUVJPR0hBRVJWQU5HT0xRUkhHT0xRUkdKSU9HSFFLQU5SU0dPcXczNWhnb2h3cmthdnJpb2d1cWdqYWhma3JnS0ZVR0hL"

Will this be taken care if we use todocument inline with json??

sunilc6392
May 19, 2023

I think you should use encodebase64string() function to achieve your requirement, may it is useful.