I have previously generated PDF files using the “Generate Document” action node, but now I would like to generate an Excel-file that contains data from my app. I can only choose PDF as the document type in this action node, and I am wondering if it is possible to somehow make an Excel-file instead? If not, are there any other ways to generate an Excel-file from Appfarm?
Use the “Export data” action node and you will get a CSV. You can find all the information in the documentation and there’s also an example in the showroom.
Use an external library and export the Excel file with “Run code”. The advantage here is that you can build the file with different data sources and structure it the way you want. First, you need to add the excelJS as a Custom Header Tag under Environments.
(Script URL: https://cdnjs.cloudflare.com/ajax/libs/exceljs/4.4.0/exceljs.min.js). Then you can create your file by using “Run code”. Here is an example of the function in “Run code”. Projects is the datasource and name, projectlead, startdate, state, costs, comment are properties of this datasource.