Hello everyone,
I am getting a base64 value as a request. But I am unable to convert the base64 value into an image document. As a result record is not getting stored into the database table. Is there any way to convert the base64 string into document?
Discussion posts and replies are publicly visible
Where do you get that image from? An API? Did you configure the API to turn base64 data into files?
Actually, I have exposed a service in appian to write data into record and consume the service from a different platform. That system is sending the image in base64 format, but after getting the base64 value I am not able to generate the document in appian.
OK. What did you do so far? A good implementation example is here
https://docs.appian.com/suite/help/23.2/passing-a-web-api-document-into-a-process-model.html#
You can not, and don't have to, do any kind of "active" base64 conversion. Appian manages that for you.
I am able to create the document from the received base64 from API and save the document into a folder. But I am not getting the complete image and the size of the image is reduced from 110 kb to 2.9 kb.
Appian does absolutely nothing to your images.
Hi Stefan, We have are requirement where we need to embed documents as Base64 in a JSON request and keep the format of the JSON in such a way as the called system requires. Here we are talking about two collections , where second collection is a array of some repeated fields and one is base64 where document is passed. Now Appian in its notes says that we should let it convert it to JSON for documents to convert to Base 64. But then how ill we achieve this structure of the request we need to send to the called system?Sample example is-
{ --colection1
"DocInitialixation" :{"Input":
[
{"Id":"IdValue1","Value":"ValueHere1"},
{"Id":"IdValue2","Value":"ValueHere2"},
{} --so on
],"
DocCollection": - collection 2
{"base64":document1,
"mimetype":"MimeValueHere",
"SomeOtherAttribute1",
"Value here1"
},
{base64":document2,
"SomeOtherAttribute2","Value here2"},
{}.. so on
]
Here how to achiive this pattern with the restrictions highlighted in Documentation?
I would try to just create a dictionary or map for the body of the request and make sure that the values where the document go are of type document. Then Appian will turn that dictionary into a JSON structure when sending the data.
Is that something you already tried?
Hi, Can you please explain how you where "able to create the document from the received base64 from API"Anything you can share would be amazing
Maybe this will help:
Hi, appreciate it, and am currently discussing this option with the external system. Currently they want to send us an image as base64, and i have no guarantee that they will offer an endpoint for me to pick up the data
After invoking an integration object try to send a base64 value as a response. In the integration object there is a checkbox called "Convert base64 values to Appian documents", select this option and folder to store the document. Appian will automatically convert your base64 value into document.