Forum Discussion

VenuVaddella's avatar
VenuVaddella
Qrew Trainee
6 years ago

I have an URL(API) and it returns a number value and i want to store response into a field.

Please copy paste the below url in the browser and you can see the map {"rate":0}. 

http://solgenservices.com/api/QB/taxrate?street=5102 S Coulee Vista Dr&city=Kennewick&zipcode=99338

This is my formula written in Quickbase to pass the street , City & zipcode dynamically. 

http://solgenservices.com/api/QB/taxrate?street="&[Address: Street 1]&
"&city="&[Address: City]&
"&state="&[Address: State/Region]&
"&zipcode="&[Address: Postal Code]

My requirement is to store the response 0 into a field in quick base.Please let me know if this can be achieved. 
  • You can toss some Javascript into a formula-url - and if your solgen services site accepts https request doing something like this: 

    var text map = http://solgenservices.com/api/QB/taxrate?street="&[Address: Street 1]&
    "&city="&[Address: City]&
    "&state="&[Address: State/Region]&
    "&zipcode="&[Address: Postal Code]


    NOTE: The syntax below is a rough outline - it will need to be tweaked to work in an actual formula

    javascript: {
    $.get('" & $map & "').then(function(data,success){
    //parse the response here
    $.get('" //do an api_editRecord call to Quick Base with your response "'); }

    Basically do a GET request to your map service - within the GET call - work out the response in the .then function and then chain another GET call to store that value into Quick Base

    Chayce Duncan | Director of Strategic Solutions
    (720) 739-1406 | chayceduncan@quandarycg.com
    Quandary Knowledge Base
    • VenuVaddella's avatar
      VenuVaddella
      Qrew Trainee
      Thanks for your reply. 

      I am newbie to Quickbase. Could you please help me with the complete code? 

      DB ID: bpn3pd7fz
      Field ID: 184. 

      Let me know if you need more details. 
    • ChayceDuncan2's avatar
      ChayceDuncan2
      Qrew Cadet
      I'm happy to help with the Quick Base side - but for full disclosure I'm having a hard time trying to pull anything from your map and nothing loads for me when I go to the link

      From a Quick Base standpoint though - the code looks like this: 

      var text map = "http://solgenservices.com/api/QB/taxrate?street="&[Address: Street 1]&
      "&city="&[Address: City]&
      "&state="&[Address: State/Region]&
      "&zipcode="&[Address: Postal Code];

      "javascript: {" & 
      "$.get('" & $map & "').then(function(data,success){" & 
      //You'll have to do your own coding here - if you can do a GET request against your mapping API - you'll need to parse the response here - so you can pass it into the Edit Record below
      var mapValue = "";
           $.get('https//yourealm.quickbase.com/db/bpn3pd7fz?a=API_EditRecord&apptoken=enteryourtoken&rid=" & [Record ID#] & "&_fid_184=' + mapValue);" & 
      "});" & 
      "}"

      Chayce Duncan | Director of Strategic Solutions
      (720) 739-1406 | chayceduncan@quandarycg.com
      Quandary Knowledge Base
    • VenuVaddella's avatar
      VenuVaddella
      Qrew Trainee
      Thank you so much sir. 
      But getting below error. Please help.