I have a requirement that I need to generate a report and need to attach generated excel report in the email, for that we are using pxGenerateExcelFile OOTB activity to generate a excel file, after that we need to attach the excel in the mail, so I am using @uploadFile() function to get the encoded string of excel file.
The function returning FilePath,FileName,FileExtension and FileData, but I need only FileData for sending email notification.
I have tried whatcomesafterlast to get the only Filedata and also tried replaceall function to replace other fields with null, but none is working with encoded string.
Is there a way to get only filedata from uploadfile function?
@Nadimuthu T Thank you for your response, I have gone thorough the activity pyActionSendMail, We have also implemented similar steps with reportdefinition to create a page list and pxGenerateExcelFile activity, Where as we have used same java step in our activity what is present in pyActionSendMail.
My logic is working obsoletely but the concern is java step, we have been asked to avaoid java step, that is the reason we are going with @uploadFile() function to get the encoded string of excel file but the function returning FilePath,FileName,FileExtension and FileData, but I need only FileData for sending email notification.
Updating the solution here so that it can be useful for others.
The reason we are not able to use string functions like @whatcomesafterlast, @replaceall,… is uploadFile() returns a hashmap object which contains data in key value pairs fashion.
Though a param variable is able to reference this hashmap object contents in tracer, string library functions cannot be used as this is a java object.
Using below code snippet, the hashmap object can be converted into string using typecasting.
//assuming pxRequestor.pyFileUpload contains the file path/directory location
//Eg of pxRequestor.pyFileUpload = file://web:/StaticContent/global/ServiceExport/sample.csv