I want to send the data through the loop. Like i am running a loop to store the data into the server not stored due to lack of internet connectivity and which is in indexedDB of a browser.
While running loop when i try to store the data in the loop like
Codefor (let Data of request.result){
survey.data = sData
delRespID = sData.RespID
survey.sendResult({PostID})
};
Then there is onsendresult function where i am checking if the data has been successfully sent to the server then want to delete those
records from IndexedDB in the browser.
Codesurvey.onSendResult.add(function (survey, options) {
if(options.success===true){
deleteData(delRespID);
}
});
But the problem i am facing is, the loop gets executed first for all the records and then it executes this onsendresult function due to which i am facing problem to fetch the ids to delete from indexedDB. So, my query is how can i execute this onsendresult function immediately after each record is sent to the server.