Forum Discussion

EricTurrentine's avatar
EricTurrentine
Qrew Cadet
8 years ago

Ingnore Reporting Error 400 on add new record

I am using Quick Base Actions to add a new record to a child table when a new record is added to the parent. The parent table is  connected to a Drop Box CSV file and the field I am copying is the Key field in the Child Table. The copy is working fine, but when I rerun the Connected table Sync to update the parent table the Action is triggered. When the action try's to add a new record to the Child table it raises the 400 error "cant add duplicate record to Key field".

My question is can the 400 error be ignored and not be reported as a failure. I am still in the testing faze but production will have over 10,000 records that is a lot on error messages

  • I suggest that you put a condition on the Action so it does not try to duplicate a Key field.  I'm not quite sure I understand your setup in terms of duplicating the Key field, but it sounds like you have a 1 for 1 relationship where every parent has exactly 1 child record and you have set the Key field of the Child to be the same as the Record ID# of the Parent.

    If that is the case, then you should be able to do a summary field of the # of children, and not fire the Action of the Parent already has it's child record created. 
    • EricTurrentine's avatar
      EricTurrentine
      Qrew Cadet

      Sounds like we are on the right track I tested the solution but still got the error.

       below is the criteria I added

      this is a one to one as you stated The parent is a read only Synced table with 28 fields and the Child has additional fields that needed to be added to the work order table and needed to be editable by the user

  • I am not sure what your setup is or what the error a "400" refers to. Is it a HTTP Status code 400?

    https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/400

    I don't see anything close to a "400" error code in the HTTP API:

    https://help.quickbase.com/api-guide/index.html#errorcodes.html

    If API_AddRecord is generating the error there is a parameter ignoreError you can add to the call:

    HTTP API API_AddRecord
    https://help.quickbase.com/api-guide/index.html#add_record.html

    A screenshot or more details would help understand what is going on.
  • Before you get into non native solution, I suggest my solution to avoid trying making duplicate Key fields.
    • _anomDiebolt_'s avatar
      _anomDiebolt_
      Qrew Elite
      You could try and add  the parameter ignoreError  to the API_ImportFromCSV call and cross your fingers.  Sometimes there are undocumented parameters on the various API methods. Otherwise you can use script.
  • Eric, your condition is backwards, right. You want to fire when the # of children is 0 not 1
    • QuickBaseCoachD's avatar
      QuickBaseCoachD
      Qrew Captain
      Great, thx for letting me know.
      It is actually pretty cool that that works as Quick Base is essentially mass updating and then for each record imported it needs to calculate that summary field to decide if it needs to fire the Action.