Formula text button to create Quick Base Action (Add Record) and redirect to that record

  • 0
  • 1
  • Question
  • Updated 5 months ago
  • In Progress
I have a formula text button in a table to check a box in one table, fire an Action to create a new record in another table. Right now the formula takes me back to the original table. I need to go to the record in the new table.
Photo of Joey Zint

Joey Zint

  • 1,508 Points 1k badge 2x thumb

Posted 1 year ago

  • 0
  • 1
Photo of QuickBaseCoach App Dev./Training

QuickBaseCoach App Dev./Training, Champion

  • 52,826 Points 50k badge 2x thumb
I suspect that will be impossible as to redirect to that newly created record, you would need to know the Record ID,  and that is not know at the time the button is pushed.

One solution would be to redirect the user to a report of records created just now (in that table of records that the Action created).  So a report sorted by date created, newest on the top and created in the last minute.

I was going to suggest a report of records a "I" created today by the current user, but I think that the [Record Owner], unfortunately is the Action Owner and not the Current user.

So basically land the user on a report where the top record on the report is likely the one that just was created.
Photo of Ⲇanom the ultimate (Dan Diebolt)

Ⲇanom the ultimate (Dan Diebolt), Champion

  • 27,754 Points 20k badge 2x thumb
Why not just bind a script to your button and use some simple JavaScript to call API_AddRecord and redirect to precisely the URL you want? The features that QuickBase has added (I am looking at you actions) perform a specific task but in a hardcoded way and don't have any extra configuration if you don't see a control in the graphical interface. 

Just go all in on using script any these and other obstacles evaporate.
Photo of Paul Vorster

Paul Vorster

  • 556 Points 500 badge 2x thumb
Hi Dan, can you maybe supply me with an example of your statement above, as I am trying to do exactly the same?
Photo of QuickBaseCoach App Dev./Training

QuickBaseCoach App Dev./Training, Champion

  • 52,826 Points 50k badge 2x thumb
Paul,can you explain what you are trying to do?  Maybe there is a non script solution.  If you use a regular API to API_AddRecord and suffix it with &disprec=1 then it will land the use on the newly created record.
Photo of Paul Vorster

Paul Vorster

  • 556 Points 500 badge 2x thumb
Hi Mark, thank you for responding swiftly...I am in the process of developing a Customer Call Centre and the the call centre agent needs to Verify the Customer Details as "Passed" or "Failed".  The trick of these two buttons are, the record hasn't been created yet.  I have managed to get "Passed" working, by using the "SaveAndNextTab.js" provided by Alex Wilkinson (https://community.quickbase.com/quickbase/topics/how-do-i-create-a-button-that-allows-the-user-to-continue-to-the-next-tab).  I am now struggling to configure the "Failed" button, because it doesn't go to the next tab, but it goes to a different tab or different form.  I hope this makes sense...in essence I need to register the record, update the checkbox for "Failed" and move to a tab or a form to provide comments for Failure.  As I have realised, you need to run two separate calls, 1. Creating the Record, and 2. redirecting to the Tab/Form (I know you have provided a solution to go back to a report, but unfortunately the call centre agents works against time, and they need to click on a new tab or form).  I am willing to share my app as well, if you want to look at the code? 
Photo of Paul Vorster

Paul Vorster

  • 556 Points 500 badge 2x thumb
I have now tried your suggestion, and the code looks as follows:
"<a  class='Vibrant Success' href='" & "bnhjm55g9" & "?a=API_AddRecord&apptoken=b5grgfsu68y86brzbpwkdybed6z&_fid_2=" & [Record ID#] & "&disprec=1" &  "'>Make an Enquiry</a>"

1. It creates the record, and refresh the screen, but the data fields are empty. I would need to add the checkbox update to it and populate the data? or redirect to another form? 
Photo of QuickBaseCoach App Dev./Training

QuickBaseCoach App Dev./Training, Champion

  • 52,826 Points 50k badge 2x thumb
What fields are you trying to populate?

and what's going on here

&_fid_2=" & [Record ID#] 

You cannot populate data into fid 2 as that is a built in field which is not updatable.


the idea is to line up the fields you want to populate like

& "&_fid_12=" & urlencode("something into fid  12")
& "&_fid_13=1" // set fid 13 to be true (checked)
Photo of QuickBaseCoach App Dev./Training

QuickBaseCoach App Dev./Training, Champion

  • 52,826 Points 50k badge 2x thumb
Can you contact me via the information on my website QuickBaseCoach.com