Forum Discussion

CarolMcconnell's avatar
CarolMcconnell
Qrew Captain
5 years ago

HTML Form Submission

Trying to develop a form on our website that when populated and submitted will add a new record to QB.

Can get to the form and create a record but no data is saved to the fields.

Here is an example of what we are using.  

Anything off hand that you see is causing this problem?

<form name="qdbform" method="POST" encType="multipart/form-data" action="https://quickbase.corp.com/db/bp2na9h30?a=API_AddRecord&apptoken=123thiaofj456">                                                                                                                                                                                                                              
Field 1: <input type="text" name="_fid_6" id="_fid_6"><br>
  Field 2: <input type="text" name="_fid_7" id="_fid_7" ><br>
  Field 3:<input type="text" name="_fid_8" id="_fid_8"><br><br>


------------------------------
cowannbell
------------------------------

5 Replies

  • AustinK's avatar
    AustinK
    Qrew Commander
    I'm not sure you can do it via HTML like that. For one thing the URL you are trying to use is not going to work. I assume you switched that out for posting to the forum though.

    https://help.quickbase.com/api-guide/add_record.html

    You can check Stack Overflow to see how you can intercept your form data and build the xml before submitting it. There might even be an easier way but I found this. https://stackoverflow.com/questions/2088862/how-to-post-xml-to-server-thru-html-form

    If you want it to post via a URL you are going to need to follow the URL example from the first link above. 
    https://target_domain.quickbase.com/db/target_dbid?a=API_AddRecord&_fnm_second_year=1776
    &_fid_8=changed&ticket=auth_ticket&apptoken=app_token
    • CarolMcconnell's avatar
      CarolMcconnell
      Qrew Captain
      What is this part "&_fnm_second_year=1776" of the url?

      ------------------------------
      cowannbell cowannbell
      ------------------------------
      • AustinK's avatar
        AustinK
        Qrew Commander
        That is just another way to identify a field. Fnm = field name similar to how fid = field id. They can usually be used interchangeably, I just copied the URL alternative QuickBase gave. 

        Also I think this help doc might be good to read. If you do the URL alternative I mentioned previously you will need to make it a GET request, one of the things it mentions. https://help.quickbase.com/api-guide/understandreference.html#sample_text

        Another option to do what you are wanting would be using some kind of intermediary like Workato or Zapier or something else that can send a webhook. That might be easier to do but that will depend no how comfortable you are with coding.