Hi All,
I am getting the below exception while triggering the REST API when the button is clicked in the table.
Cannot read property 'S3Data' of undefined.
Here is what I am doing in the app.
- Call the REST API#1 and populate the data in the table.
- Added Action Button with Label as "Download".
- When the Download button is clicked then it needs to get the column of the selected row as input and call the REST API#2.
- REST API#2 gets the data specific to the table row and using utils. downloads to download the file.
Here is the query I am using for downloading the data
//REST API#2 call
getArchiveData.trigger();
//Download the data from REST API#2
utils.downloadFile(getArchiveData.data.SelfServeInvoiceAPIResponse.S3Data.edi_data,getArchiveData.data.SelfServeInvoiceAPIResponse.S3Data.s3_file_name,'')
When I click first, looks like it's not returning any data in S3Data, and want to check how to disable this error message.
This error goes off when the query runs and I need to click 2 times to download the data.
I have also noticed, it always downloads the previous row data instead of getting the current row. How can I get the data of the current row?
Here is the parameter that I am passing from table1 to get the data from REST API#2.
"downloadS3Data":[
{
"invoiceNumber": {{table1.selectedRow.data.invoice_number}},
"ExecId":{{table1.selectedRow.data.exec_id}}
}
],