WHEN 1 RESULT IN SEARCH, DIRECT TO FORM INSTEAD OF REPORT

  • 0
  • 1
  • Question
  • Updated 2 years ago
  • In Progress
I'm looking for a way to give my users a faster way to retrieve their search results (fewer clicks.) Right now when creating a report utilizing "ask the user" on a specific field it returns the values in a table instead of directly to the form. Just cumbersome and needless. 
What I'd like to do is essentially re-create the quick table search on a homepage. When what I'm searching for has a single exact match, the record is presented in form view instead of a table.
If there is a quick URL I'm overlooking and could utilize to create a field for and set as the default value right on the form would be great. Allowing them to easily bounce from the current record to another as well. My coding skills are clearly less than optimal. Any ideas?
Photo of GB_DirectorOfOne

GB_DirectorOfOne

  • 70 Points

Posted 2 years ago

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

QuickBaseCoach App Dev./Training, Champion

  • 51,326 Points 50k badge 2x thumb
Can you clarify where the user is when they are running this query?  Are they sitting on a record?  Can you give an example using a use case with your table names so I understand the business objective here.
Photo of Matthew Neil

Matthew Neil

  • 31,438 Points 20k badge 2x thumb
My guess is to save clicks... which saves time... which saves money...
Photo of Ⲇanom the ultimate (Dan Diebolt)

Ⲇanom the ultimate (Dan Diebolt), Champion

  • 26,512 Points 20k badge 2x thumb
Use script - here are the guts of the code:

Pastie Database
https://haversineconsulting.quickbase.com/db/bgcwm2m4g?a=dr&rid=578

Notes:

(1) The script uses ES6  backticks for string interpolation

(2) The script uses ES6 fat arrow notation for functions
Photo of GB_DirectorOfOne

GB_DirectorOfOne

  • 70 Points
Sure... this is a single table, "MFG SOPs." A single records for each of our suppliers utilized by our Item and Cost Maintenance Group. It's a glorified spreadsheet in that one person on the team has the ability to edit, while the balance of the team can view records only. The initial excel file simply had a tab for the data manager, and another for the team to use in which they entered a MFG Code and a series of vlookups pulled over the data onto the "form." The issue is that over time it has become a very large excel file and was cumbersome to both edit and share.

In rebuilding it I'd like to try and keep the easy type in MFG Code interface with the team at large, and from the Dashboard I just use the quick built in table search feature and use an exact match. That brings me right to the data form in view only mode for the team. PERFECT!

But if I create a report in which I specify the user to select the MFG Code (from a list of 60k+) it kicks into a report first for them to have to click and view the form. Not a big deal I suppose, but it's an additional step. Additionally, I'd love to embed something like the Dashboard built in search in the form for them to find another without having to exit to the table's default report.
Photo of QuickBaseCoach App Dev./Training

QuickBaseCoach App Dev./Training, Champion

  • 51,096 Points 50k badge 2x thumb
I finally understand what GB is saying.

GB  likes the smart behavior of the dashboard Search feature that if it only gets a single hit rather than returning a report with one record, it displays that 1 record on a form.
Photo of GB_DirectorOfOne

GB_DirectorOfOne

  • 70 Points
Sorry @Danimal, my follow up was meant for @QuickBaseCoach App Dev./Training.
Ironically though, I have no idea what you are saying in your reply either, but also have no doubt it would solve my problem. (I come from the business side and am learning the IT coding piece.) You're both great resources in the community. Thanks so much.
Photo of QuickBaseCoach App Dev./Training

QuickBaseCoach App Dev./Training, Champion

  • 51,096 Points 50k badge 2x thumb
GB, does the user know the Record ID or the Key field of the record they want to jump to?
Photo of GB_DirectorOfOne

GB_DirectorOfOne

  • 70 Points
Yes, I made the MFG Code the key field. 
Photo of QuickBaseCoach App Dev./Training

QuickBaseCoach App Dev./Training, Champion

  • 51,096 Points 50k badge 2x thumb
if you want to make a formula URL button to go to a record on a form , then you can make a formula like this

URLRoot() & "db/" & dbid() & "?a=dr&key=" & URLEncode([mfgr])

That will display the record.

To edit the record, change the dr to er.  (ie instead of display record its edit record)

If the record is not in the same table that the URL button is on, then you need to specify the whole table name from Advanced Properties/.

URLRoot() & "db/" & [_DBID_MY_TABLE_NAME] & "?a=dr&key=" & URLEncode([mfgr])