FIle Extension for Get Base64 document from Database

Hello, 

I have a requirement where different consumers (stored as a process variable) of WebAPI send different XLS formats (eg: one sends file name as  ".xls" and other sends as ".xlsx"). In the process model, I am using "Get Base64 document from database" fucntion where the document file name is stored as a column in a table ie. file name is stored as "ABC.xls" or "ABC.xlsx". I am checking the source on the "format" field of Inputs in the function and setting the value based on process variable like below: 

if(pv!source="TEST",".xls",".xlsx")

But when I try to download the document from document download link function then locally the file is stored as "ABC.xls..xls" which I was able to open atleast in Excel but how do I save the file with its original name and extension like "ABC.xls" only?  I tried using if(pv!source="TEST","",".xlsx") and in this case the file name is stored as "ABC.xls_" (looks like the empty spaces are replaced by underscore characters). Any insight is appreciated. 

 

Thanks

  Discussion posts and replies are publicly visible