how to create a url formula for a button to automatically check a check box field?

  • 0
  • 1
  • Question
  • Updated 4 years ago
  • Answered

I am trying to create a URL formula that will display on a report as a button. i want this button to automatically open up the record check the box and then save it.

the reason i want this is because i am creating a project management system. and i have it set up to assign tasks to everyone in a certain department. once these tasks are assigned to the 4 or 5 people in the department, one individual can then go in and pick up the task and personally assign it to himself.

right now i have form rules set up so that whenever someone check the box "i want to pick this task up" it automatically fills in the user field "picked up by".

it would be great if they were able to pick up tasks right from a report on the homepage dashboard instead of having to open the individual record, edit it, check the box, and then save it. any help would be greatly appreciated. thank you in advance.

Photo of Conner

Conner

  • 40 Points

Posted 5 years ago

  • 0
  • 1
Photo of QuickBasePros_IDS

QuickBasePros_IDS, Champion

  • 3,772 Points 3k badge 2x thumb
This will update your checkbox and return you to either a report or a table-dashboard (see further instruction below)


URLRoot() & "db/" & Dbid() & "?a=API_EditRecord&apptoken=b5cpi9xccqucym2avvkqhhs53k&rid=" & URLEncode ([Record ID#])
& "&_fid_28=1"
& "&rdr=" & URLEncode(URLRoot() & "db/" & Dbid() & "?a=q&qid=1")


Replace b5cpi9xccqucym2avvkqhhs53k with an application token from your own application (or create one if you do not have one already)

Replace 28 with the Field ID (FID) of the checkbox-field you are updating (=1 represents a true value for a checkbox field; conversely 0 would be unchecking a box)

Replace qid=1 where 1 is the query ID of the report you want the User to return to when the Edit Record is finished. If the user starts in a report, you want to use the qid value of that report (you can see this in the URL bar when you click on any report in QuickBase). If you want the user to return to the Table Dashboard; then change it to "?a=td"

Remember - if you expect the User to be on a table-dashboard report to activate this button; the button must exist in either the default report for the table; or the report which is used for their Role on the table-dashboard page.
Photo of Conner

Conner

  • 40 Points
I changed the FID and created an application token and replaced it. i also place it to ?a=td because they will only be doing this from a homepage dashboard. but i keep getting a formula error saying [record ID#] is not a field in this table. any idea?
Photo of QuickBasePros_IDS

QuickBasePros_IDS, Champion

  • 3,772 Points 3k badge 2x thumb
[Record ID#] is the default name of the key field of a table.  You have probably renamed it.  Look in your fields list for the field name with the yellow key next to it - this is the Key Field name and you should replace [Record ID#] with this field name.
Photo of Conner

Conner

  • 40 Points
okay great i got that part to work. just 2 final questions. when i push the url button it does check the box and assign it to me. but the field "picked up by" does not fill in with my user name. also is there a way to have this function return the user to the home screen dashboard instead of the table dashboard or the report?
Photo of QuickBasePros_IDS

QuickBasePros_IDS, Champion

  • 3,772 Points 3k badge 2x thumb
So, now because you're using the API to modify the record, the Form Rules don't work (Form Rules only work when the user is modifying a Form and saves a record). So you need to add in a line to populate the User field, substituting 33 for the FID of your User field.


URLRoot() & "db/" & Dbid() & "?a=API_EditRecord&apptoken=b4cpi8xccqucym2avvkqhhs53k&rid=" & URLEncode ([Record ID#])
& "&_fid_28=1"
& "&_fid_33=" & URLEncode(User())
& "&rdr=" & URLEncode(URLRoot() & "db/bhfdbn634")

Your last line rdr (redirect) needs to hard code the application dashboard page (substitute bhfdbn634 for your Home-Page DBID - click on the HOME icon then copy the DBID in the URL); although I am surprised you want to do this since your button-update link is going to be on the table-dashboard page. Your Users will be redirected to a different dashboard; but if they have to make more updates they will need to go back to the table-dashboard to get to the link again.
Photo of Conner

Conner

  • 40 Points
Thank you so much for your help. are there any guides or resources i can use to start teaching myself how to create these?

once again you have been beyond helpful for me. thanks so much!
Photo of Markus

Markus

  • 0 Points
This is the closest to the problem I am having.  Can someone elaborate how to update the User field to get around this?  I too am trying to use a button to date stamp some fields and using formula rules to update others.
Photo of QuickBasePros_IDS

QuickBasePros_IDS, Champion

  • 3,772 Points 3k badge 2x thumb
Markus, feel free to reach out to me offline; so I can try to help you better.
Photo of Markus

Markus

  • 0 Points
I posted my solution on another stream.  Thank you for your willingness to assist.  I believe you replied on that string as well.  I was able to code it so that I could grant rights with two clicks, my button then save.  If there is a way to do so with this user field approach, I would be curious and interested.

Thanks!