Forum Discussion

JessicaFeauto's avatar
JessicaFeauto
Qrew Member
6 years ago

Multiple APIs in One Webhooks

I have a URL formula button that executes the API_DoQueryCount and then executes API_Edit Record to add the query count to the record.  The button works great but I'd like to do it in an automated fashion when the record is saved.  Is there anyway to do this?

------------------------------
Jessica
------------------------------
  • Yes, easy to do with script. I'll try to show you an example next week when I have more time.

    ------------------------------
    Everett Patterson
    ------------------------------
    • JessicaFeauto's avatar
      JessicaFeauto
      Qrew Member
      Thanks Everett.

      I've been able to get most of the way there using some IOL and modifying some of Dan's code

      I basically want to count how many records in the table with the same first name (Field 11) and last name (Field 10) as my current record and input this into field 14.  The problem is, the way I've written it, it only executes on the add record initiation, at which point there is no first or last name.  Any recommendation on how to modify this to execute on record save?

      (function(){
      var querystring=document.location.search;
      if (/nwr/i.test(querystring)) {
      //ADD RECORD PAGE ========================================
      var dbid = "XXXXXX";
      var apptoken = "";
      $.ajaxSetup({data: {apptoken: apptoken}});
      var promise = $.get(dbid, {
      act: "API_DoQueryCount",
      query: '{11.CT._fid_11.value}AND{10.CT.Smith}',
      clist:"11"
      }).then(function(xml) {
      console.dirxml(xml);
      var numwithSameName = $("numMatches", xml).text();
      console.log(numwithSameName);
      _fid_14.value =numwithSameName;
      });
      }
      })();


      ------------------------------
      Jessica Feauto
      ------------------------------
  • EricMohlman's avatar
    EricMohlman
    Quickbase Staff
    Quick Base Webhooks can only call a single action. They also don't have a "listening" option to receive a response and take additional steps.

    If you truly want to have a multi-step workflow, I suggest utilizing a third-party integration platform like Zapier or Workato until we incorporate our Cloudpipes acquisition into Quick Base. If you're also comfortable with coding, creating a custom script hosted somewhere could also accomplish what you want.

    ------------------------------
    Eric Mohlman
    ------------------------------