Hi!
Can someone explain how do I use a!exportDataStoreEntityToExcel() in web api? im still learning about webapi if someone could simplify it for me or give me some documentation, or both, I would really appreciate it.
Thank you
Discussion posts and replies are publicly visible
You can create a POST method Web API and try out the below sample code which will return the excel document generated.
a!exportDataStoreEntityToExcel( entity: cons!DATA_STORE_ENTITY, documentName: cons!DOCUMENT_NAME_TO_BE_GENERATED, sheetName: "EXCEL_SHEET_NAME", saveInFolder: cons!DOCUMENT_SAVE_FOLDER, selection: a!querySelection( columns: { a!queryColumn( field: "column1" ), a!queryColumn( field: "column2" ) } ), filters: a!queryLogicalExpression( ignoreFiltersWithEmptyValues: true(), operator: "AND", filters: { a!queryFilter( field: "column1", operator: "=", value: "filterValue" ) } ), onSuccess: a!httpResponse( statusCode: 200, headers: { a!httpHeader( name: "Content-Disposition", value: concat( "attachment; filename=""", document( fv!newDocument, "name" ), ".", document( fv!newDocument, "extension" ), """" ) ) }, body: fv!newDocument ), onError: a!httpResponse( statusCode: 500, headers: {}, body: "500 Internal Server Error" ) )
can you help us getting the same code for Get as well . Thanks
This will not work with a GET operation as the a!exportDataStoreEntityToExcel() function can only be called in a POST.
Thank you Stefan. My scenario is that on a single click i want the data to export to excel from a query rule .we recently upgrade our system to 21.4 can you suggest the way .Thanks
This scenario cannot be implemented in a single click.
Thank you..!