Forum Discussion

ChristineKirk's avatar
Qrew Cadet
23 days ago

What is the matter with my API Button formula?

Trying to create an API button to open a new record in another table (ideally will love to build this out while passing details on to specified fields. But. I can't even just get it to do a new record).


What gives? I've compared this to some of my other similar records, and can't figure out why this won't work.



4 Replies

  • Nevermind, got this one myself! Missing end quote.

    Working on passing populated details -- Sharon/Quickbase Junkie is really helpful here, but still a little green to me.


    Thanks all!!!

    • MikeTamoush's avatar
      Qrew Commander

      If you want to set fields during the add, use API_GenAddRecordForm. Here is my cheat sheet:

      URLRoot() & "db/bp554hgmz?a=API_GenAddRecordForm"
      & "&_fid_6=" & URLEncode ([Related Field])
      & "&_fid_7="  & URLEncode("some text with spaces or special characters")
      & "&_fid_8"  & [a numeric field]
      & "&z=" & Rurl()

      //urlencode only needed in fields with spaces or special characters ; This shows how you can set multiple fields during your Add Record Api.

      • ChristineKirk's avatar
        Qrew Cadet

        Thanks, Mike! I spent collective hours on this and another API button yesterday trying to get it right and gave up with "Good enough". Maybe you can help with a couple other things I'd like to achieve:

        1. Can I have this GenerateAddRecordForm in the background, while passing through these details? Alternatively, maybe if it pops up an in-window popup similar to how it does when you go to "Add New Record" from the embedded drop-down? Basically I want to streamline this as much as possible for folks. Either if they don't see the popup at all or if they do and it's in window, that would feel the most intuitive to me without distracting them. My folks work on a small screen remotely, and so I do my best to keep everything streamlined on one page/one tab to the extent possible.
        2. Separately - Can I get it to open in VIEW form, a form on a parent table? (Again would be awesome if this can even be in embedded popup form, and they can click in/out of it as needed, but a popup or another tab will work just fine). For that specifically, I've moved the fields over to the child table, and pulled it to a separate section of the form as read-only, so they have it there as reference, but first off, having two identical forms in two places seems silly, and second, they don't love it anyway. Would rather just go right to the source where we're maintaining the info and just maintain one area. For instance, if I add a field to the parent, I have to remember that needs to land in this child mirror-form-section.