Add Record with JavaScript

  • 0
  • 1
  • Question
  • Updated 5 months ago
  • Doesn't Need an Answer
Hello,

I am currently trying to add a record to already existing DB and I have code that is already adding records to the DB. My issue is my code will add a record but will not assign fields to the record.

function AddDriverToQB(Driver, PolicyReviewData, apptoken){
    console.log(PolicyReviewData[0].insured_name);
    console.log(Driver[0].age);
    var AddDriverURL = "https://ctc.quickbase.com";
        AddDriverURL += "/db/";
        AddDriverURL += DBID;
        AddDriverURL += "?a=API_AddRecord";
        AddDriverURL += "&_policy___cert__no_="+ PolicyReviewData[0].policy___cert__no_;
        AddDriverURL += "&_insured_name=" + PolicyReviewData[0].insured_name;
        AddDriverURL += "&_driver_name=Guy Richie";
        AddDriverURL += "&apptoken=" + apptoken;
    
    $.get(AddDriverURL, true, function(){
       console.log("Driver Added"); 
    });
    
}

The data for the input are 2 arrays that I know return values as that is what is being printed out before the Add Record. Is there any reason the record would not record fields? 

Thanks in advance.
Photo of William Marrone

William Marrone

  • 310 Points 250 badge 2x thumb

Posted 5 months ago

  • 0
  • 1
Photo of William Marrone

William Marrone

  • 310 Points 250 badge 2x thumb
Ignore my question, I forgot to include the _fnm before my field names.