Forum Discussion

Re: Formula URL button using Javascript to display the count of records in a Table using API_DoQueryCount

This should get you started hopefully - you'll need to swap out your own DBID and realm / apptoken info as appropriate

var text urlD = "https://yourrealm.quickbase.com/db/dbid?a=API_DoQueryCount";
var text urlE = "https://yourrealm.quickbase.com/db/dbid?a=API_EditRecord&rid=***&_fid_**=";

"javascript: {" & 
  "$.get(' " & $urlD & "',function(data,success) {" & 
        "console.log(data);" &
        "var count = data.getElementsByTagName('numMatches')[0].innerHTML;" & 
        "console.log(count);" & 
        "$.get('" & $urlE & "' + count);" & 
  "});" &   
"}"

The gist - 

Do your doQueryCount - store that value in a variable count
Make another editRecord call - and pass in the variable count as part of the call

Chayce Duncan | Technical Lead
(720) 739-1406 | chayceduncan@quandarycg.com
Quandary Knowledge Base
No RepliesBe the first to reply