Encode a .xlsx file into Base64
I am working in a user story which I need to convert a Page List into a .xlsx file. After that, I need to send this file as a Base64 string inside a connector.
I separated this user story in 3 steps:
- Call MSOGenerateExcelFile to generate the .xlsx file. - Done
- Use Base64Encode() function to convert the .xlsx into a Base64 string. - Doing
- Call the integration.
I did the first step successfully, but I don't know how to do the second step.
I saw in the bellow link that I can use this function to convert a Binary File into a Base64:
So, I was thinking to create a Binary File from the .xlsx that I have and call the Base64Encode() function to do this whole process, but I cannot figure out how to convert my file into a Binary File inside Pega.
Can someone give me hints to do that or maybe suggest another approach to create the Base64 string?
Witon S. Tuji.