Please Note This forum exists for community support for the Mango product family and the Radix IoT Platform. Although Radix IoT employees participate in this forum from time to time, there is no guarantee of a response to anything posted here, nor can Radix IoT, LLC guarantee the accuracy of any information expressed or conveyed. Specific project questions from customers with active support contracts are asked to send requests to support@radixiot.com.
How to return excel-reports/run response after the status is ready?
-
Is it possible to have mango automation server return the GET message for excel-reports/run only after its status is ready aka. the report is done? I need to chain excel-reports/run with /view and it would be of tremendous help if I could assure that the report is there when the code executes.
-
Hi Nyoa,
It is unlikely we would modify it to wait until the report finished to respond to the run, but the tools do exist to perform this logic!
The response to excel-reports/run is a JSON object about the report instance that has been created. Included in that object is its ID. You can use the ID to query the excel-reports/{ID} endpoint, which will return a JSON object with a "state" attribute, which will be set to "FINISHED" if the report is finished.
-
There is also a web socket endpoint that you can register at to receive notifications for all events to a given database table. The 2 for excel reports are:
/rest/v1/websocket/excel-reports /rest/v1/websocket/excel-report-templates
Check the code in the excelReports.js file as to how these endpoints can be used. We use it to update the run reports table on the second tab after a report finishes.