Forum Discussion

AlexBennett3's avatar
AlexBennett3
Qrew Trainee
5 years ago

Setting a Default button to add default values across multiple fields.

Hey Everyone,

I have another question that I can't seem to figure out. Is there a way that I can add a button to my form that will auto-populate fields with default values, but the user can change if needed. I have a form that has 28 fields that take a # of employees. I'd like to be able to set defaults since these numbers won't change often, but when they do, the user can manually input a different number. Is this possible to do within quickbase?

Thanks,​

------------------------------
Alex Bennett
------------------------------
  • You can use API_EditRecord in a URL Button, like this:

    URLRoot() & "db/" & Dbid() & "?a=API_EditRecord" &
    "&rid=" & [Record ID#] &
    "&apptoken=token" &
    "&_fid_6=& "value" & 
    "&_fid_7=" & "value" & 
    "&_fid_8=" & "value" & 
    "&rdr=" &
    URLEncode(URLRoot() & "db/" & Dbid() &
    "?a=dr&rid=" & [Record ID#])

    ------------------------------
    Ahuva Brown
    ------------------------------
    • AlexBennett3's avatar
      AlexBennett3
      Qrew Trainee
      I'll see if I can give that a shot. 

      Thanks!!

      ------------------------------
      Alex Bennett
      ------------------------------
    • AlexBennett3's avatar
      AlexBennett3
      Qrew Trainee
      Hey Ahuva,

      Could you give me some tips on getting this set up? I've got the API Call set up and created an app token, changed the fid's to the desired values, but getting errors for invalid input (Code 2). Will this allow me to create a button that will add these values to the fields I select?

      Thanks,

      ------------------------------
      Alex Bennett
      ------------------------------
      • AhuvaBrown's avatar
        AhuvaBrown
        Qrew Cadet
        Can you show me your code and the error messages?

        ------------------------------
        Ahuva Brown
        ------------------------------