Conversion of Base64 value into image document

Certified Associate Developer

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

Parents Reply
  • 0
    Certified Senior Developer
    in reply to Stefan Helzle

    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,

    "mimetype":"MimeValueHere",

    "SomeOtherAttribute2","Value here2"}, 

    {}.. so on

    ]

    Here how to achiive this pattern with the restrictions highlighted in Documentation?

Children