Forum Discussion

ROBERTSACHS's avatar
ROBERTSACHS
Qrew Cadet
2 months ago

Selecting which fields to display from Formula URL searches

I have a number of Formula fields in my database which are searches of my database based on the contents of another field.   The general form is this:

URLRoot() & "db/" & Dbid() & "?a=QuickSearch2&srchtxt=" & ToText([<SOME FIELD>]) &"&exact=false"

(This approach may be out of date now, but it was current when I built the original database in 2017).  

Here is the problem:  The fields that get displayed are determined by which fields are designated as "This field may be used in reports."   

However, what I want is way to differentially control which fields are displayed, depending on which fields are being searched, whether this is done as part of the formula, or through some other mechanism.

For example:   Assume I have 4 content fields

Category, Manufacturer, Salesperson, Location.

And two "search fields" using the approach above:

Search_Category: URLRoot() & "db/" & Dbid() & "?a=QuickSearch2&srchtxt=" & ToText([Category]) &"&exact=false"

Search_Location: URLRoot() & "db/" & Dbid() & "?a=QuickSearch2&srchtxt=" & ToText([Location]) &"&exact=false"

When I search on the contents of "Category" (I.e., looking for all records with the same product category as the current record), I want the Manufacturer field to show up as a column in the search results, but not Location.   When I search by Location, I want Salesperson to show up as a column but not Manufacturer.  Currently, I have to manually show/hide which fields I want to see after I do the search--very inefficient. 

For example, is it possible to define a table layout for search results as a form and then indicate the use of that form in the Formula?