Hello,
I am using Javascript to pull out a row from one table, remove duplicates, and then I want to upload those results into another table, one record for each value.
Distinct is the array, and it has the proper values. The issue I'm having is that it appears to be that the for loop is going through the values twice, as when I'm expecting 2 rows, I'm getting 4.
Distinct.forEach(function(entry){
for(index = 0, len = Distinct.length; index < len; ++index){
var xhttp = new XMLHttpRequest();
xhttp.open('POST', "[REALM]/db/[DBID]?a=API_AddRecord&[TOKEN]&_fid_6="+Distinct[index],true);
xhttp.send();
}
})
I know that I'm probably overlooking something simple, like somehow closing the request, or trying to open it more than once...
Question
API_AddRecord from JavaScript Array creating duplicates
Sign up
Already have an account? Login
Login to the community
Login with Quickbase US – quickbase.com Login with Quickbase EU – quickbase.eu
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.