Mass edit "Searchable" field for 1,000+ fields

  • 0
  • 1
  • Question
  • Updated 5 years ago
  • Answered
Hello, I'm wondering if there is the ability to do a mass-update of fields in a table to convert them from "searchable" to non-searchable. I have over 1000 fields in a table, and all of them were created to default to searchable. I only really need 2 or 3. But my searches in this table are taking a LONG time because there are so many records and fields to go through. Rather than go one-by-one, is there a way to do this efficiently?

Photo of Michael

Michael

  • 0 Points

Posted 6 years ago

  • 0
  • 1
Photo of Ⲇanom the ultimate (Dan Diebolt)

Ⲇanom the ultimate (Dan Diebolt), Champion

  • 30,184 Points 20k badge 2x thumb
The QuickBase API has a method called API_SetFieldProperties and a property named find_enabled which can set a field to be searchable or not. The script below can be modified to specify your table dbid and apptoken (if you require one) and pasted into the JavaScript console:

https://haversineconsulting.quickbase.com/db/bgcwm2m4g?a=dr&rid=222

In a nutshell, the script calls API_GetSchema on the table to obtain an array of all the fids, rejects any fid less than 6 and then calls API_SetFieldProperties for each fid. The script will take a while to run as it has to make 1000+ calls for each of your fields. You may want to put a console.log in the script for feedback on the progress of the script. Also, when the script ends you will have to manually set the searchable property on those few fields you want to remain searchable.

Don't use the script if you don't know what you are doing as I will not be responsible for any loss of data or corruption. Ask if you need further help.

You are lucky you got this script because I saved it seconds before we lost power due to the storms rolling through.
Photo of Michael

Michael

  • 0 Points
Thank you for your help. I appreciate it.
Photo of Mariya

Mariya

  • 0 Points
Can someone let me know if it is still possible to do this?  I am having the same issue.