but if I look in the log file, the content of the csv file is logged correctly.
The goal is that i read out the file and do something with the content of the file within the custom script. Why does print work but returning the result not.
Actually, it seems that when i remove the print part, it still writes the full content of the csv file to the log, so i’m doing something wrong where i’m not returning the correct data.
In other words:
var returned_result = platform.api.get( “files/files/1808.csv” ) (same if i use files/files/1808.csv?content=true)
doesn’t return the content, although when using the API Docs, it does return the information in the Response Body
And for what it’s worth: when using a different query: files/files/1808.csv?include_properties=true&content=false it does give me information back:
We have seen the same issue trying to read in a file, but were able to work around it by using an additional library to decode the base64-encoded file contents. After adding this library, I used the following script to return the file contents:
eval(include('base64.js'));
var result = platform.api.get("files/junk/test.txt?include_properties=true&content=true");
var_dump(result);
result = Base64.decode(result.content);
var_dump(result);
return result;