Question

Unable to Convert PDF Stream(Base64 Encoded) to Byte[] Array through Function.
Hi All,
We have requirement to Convert API response(Base64 format) to pdf and attach the same to the Case.
we have tried the below Java Code in Java Step and Passing the return value to OOTB Activity AttachToWork
String s = tools.getParamValue("AttachmentBody").toString(); byte[] byteArray = new com.pega.pegarules.pub.util.Base64Util().decodeToByteArray(s); tools.putParamValue("PDFDocument",byteArray);
The above is working, but our requirement is eliminate the Java Step and Activities. So we have Converted to Function. we have replaced Function in place of Java Step. Now the Function returning value is not working with OOTB Activity AttachToWork.
We have tried many ways, but still the feature is not able to achieve this functionality through functioncas. Could any one faced same issue while Convert PDF Stream(Base64 Encoded) to Byte[] Array through Function. Please suggest how to achieve this through function.
Thank you.
***Edited by Moderator Marije to change type from Pega Academy to Product***