Form Search & Filtering
Find any form in seconds with intelligent search and advanced filtering capabilities
Overview
Form search in Instafill.ai queries the workspace's form library using the workspaceId from the request's JWT token. Every search query — whether a simple name lookup or an advanced multi-filter request — includes this workspaceId as a mandatory constraint enforced by the authentication middleware in both the .NET API and Python service layers. Forms from other workspaces are never included in results, regardless of how a query is constructed.
The search index covers form names, descriptions, tags, and the metadata fields set through Form Metadata & Organization. Field names extracted by extract_pdf_components() during upload are also indexed, allowing searches like "find all forms with an NPI field" or "find all forms containing a ComboBox field named diagnosis_code". Filled data (the content entered into form sessions) is not indexed and is not searchable, preserving the privacy of individual form fill records.
Key Capabilities
- Workspace-Scoped Search: Every query is filtered to the current
workspaceIdvia JWT middleware — no cross-workspace result leakage - Full-Text Search: Searches form names, descriptions, and tags; results appear as you type
- Field-Name Search: Find forms that contain a specific field name from the extracted
{field_id, name, type}index — e.g., all forms with a field named "employer_ein" or all forms with a RadioButton field named "filing_status" - Advanced Filters: Combine date range, tag, folder, field type, and status filters to narrow results
- Saved Searches: Persist a query-plus-filter combination under a name for one-click re-execution
- Sort Options: Sort by relevance, form name (alphabetical), date uploaded, date modified, or usage frequency
- Fuzzy Matching: Handles common typos and partial matches (e.g., "W2 form" matches "W-2 Form", "empoyment" matches "employment")
- Bulk Actions on Results: Select forms from search results for bulk move, tag, archive, or delete operations
How It Works
Quick Search: Type in the search box at the top of the workspace library. The query runs against form names, descriptions, and tags scoped to the current
workspaceId. Results appear in real time.Advanced Filters: Click "Filters" to add one or more criteria:
- Date Range: Forms uploaded or last modified within a specific window
- Tags: Forms tagged with one or more specific labels (AND or OR logic)
- Folder: Forms within a specific folder or subfolder tree
- Field Type: Forms containing at least one field of a given type from
TEXT_FIELD_TYPES(Text, ComboBox, Time, Date, Number) orCHECKBOX_FIELD_TYPES(CheckBox, RadioButton) - Status: Active, archived, or draft forms
- AI Training Status: Forms with completed fine-tuning, in-progress fine-tuning, or no fine-tuning
Field-Name Search: Enable "Search field names" in advanced search to query the extracted field index. Example: searching "ssn" returns all forms in the workspace that have a field with "ssn" or "social_security_number" in the field name — useful for identifying which forms collect sensitive identifiers.
Combine Filters: Stack filters to narrow results precisely.
- Example: Tag "tax" + Folder "Federal" + Date uploaded after 2024-01-01
- Example: Field name "npi" + AI Training Status "Completed" to find CMS-1500 forms that have been fine-tuned
Save Searches: Click "Save Search" to store the current query and filter combination. Saved searches appear in the sidebar and re-execute against the current state of the workspace library — new forms matching the criteria appear automatically in results when the saved search is run again.
Sort and Act: Sort results by relevance or date, then select forms for bulk operations: move to folder, apply tags, archive, or start a batch processing job.
Use Cases
Search and filtering are most valuable in workspaces with large form libraries where locating the correct template by browsing folders would take too long. An immigration law firm maintaining separate templates for I-485, I-9, I-130, and N-400 can search "I-485" and immediately see all versions, including which have completed AI fine-tuning and which folder they live in. A healthcare billing team can filter by field name "cpt_code" to find every form that includes a CPT procedure code field, then cross-reference which of those forms have fine-tuning status "Completed" — identifying gaps in their AI optimization coverage. A financial institution processing W-9 vendor forms and 1003 mortgage applications can use a saved search for "Tag: onboarding + Status: active" to surface all current templates used in their client intake workflow without navigating the folder tree.
Benefits
- No Cross-Workspace Leakage: The
workspaceIdconstraint on every query is enforced at the middleware layer, not just in the UI — forms from other workspaces cannot appear in results even through direct API calls - Field-Level Discovery: Querying by extracted field names (from
TEXT_FIELD_TYPES/CHECKBOX_FIELD_TYPES) lets compliance teams identify which forms collect sensitive data without manually opening each form - Saved Searches as Workflows: Pinning a query like "Folder: Billing + AI Training: Completed" creates a persistent view of forms ready for high-volume use, updated automatically as new forms are added or fine-tuned
- Bulk Efficiency: Selecting all results of a search and applying a tag or folder assignment is faster than organizing forms one at a time, especially after a workspace reorganization
Security & Privacy
Data is scoped to workspaceId and protected via the shared JWT authentication middleware running in both the .NET and Python service layers. Search queries are executed against a workspace-filtered index; the middleware rejects any attempt to query without a valid workspaceId claim in the JWT. Filled session data — the actual values entered into form fields — is never included in the search index. Field names from the extracted template are indexed, but the content of fill sessions is not. Saved searches are private to the creating user unless explicitly shared with workspace members.
Common Questions
Can I search inside form field names?
Yes. Enable "Search field names" in advanced search. This queries the field name index built from extract_pdf_components() output — specifically the name property of each field record. For example:
- Searching "ssn" returns forms with a field named "ssn", "social_security_number", or "applicant_ssn"
- Searching "npi" returns all forms containing a field named "npi" or "national_provider_id" — useful for identifying which CMS-1500 or UB-04 templates are in the workspace
- Searching "employer_ein" finds W-9 or 1099 templates that include an EIN field
Note: This searches field names from the extracted template structure. The content entered into fields during fill sessions is not searchable.
How does fuzzy matching work?
The search engine allows up to 2 character differences for words longer than 5 characters. This handles common typos:
- "empoyment" matches "employment"
- "W2 form" matches "W-2 Form" (dash and space normalization)
- "applacation" matches "application"
Abbreviations are expanded via a lookup table: "SSN" resolves to "Social Security Number", "DOB" to "Date of Birth", "W2" to "W-2 Form". Fuzzy matching sensitivity can be set to Exact, Moderate, or Flexible in workspace search settings.
Can I search across multiple workspaces or organizations?
Search is always scoped to a single workspace by the workspaceId in the JWT token. The middleware enforces this at the API layer — there is no toggle to disable the workspace filter. To find forms in a different workspace, switch to that workspace (requiring membership) and search there. Organizations are isolated from each other; cross-organization search is not supported.
The public form catalog (government and standard forms like W-9, I-9, W-4, 1003) is a separate search index that is not filtered by workspace — it is used to find pre-converted forms to add to your workspace library.
What are saved searches and how do I use them?
A saved search stores a query string and a set of filters under a user-assigned name. When executed, the saved search re-runs the query against the current workspace library, so newly uploaded forms that match the criteria appear in results automatically.
Creating a Saved Search:
- Perform a search with the desired text and filters
- Click "Save Search"
- Enter a name: e.g., "CMS-1500 — Fine-Tuned", "2024 IRS Forms", "Active Employment Templates"
- Choose visibility: private or shared with all workspace members
Example Saved Searches:
- "Tag: immigration + Field name: a_number" — all immigration forms with an A-Number field
- "Folder: Billing + AI Training: Completed" — billing forms ready for high-volume use
- "Status: active + Tag: W-9" — all active W-9 templates currently in use
Workspace admins can create shared saved searches visible to the full team, ensuring consistent navigation across large form libraries.
Can I perform bulk actions on search results?
Yes. After a search returns results:
- Use checkboxes to select individual forms or "Select All" for the full result set
- Click "Bulk Actions" and choose from:
- Move to Folder: Reassign all selected forms to a target folder
- Add Tags: Apply one or more tags to all selected forms
- Archive: Move selected forms to archived status
- Delete: Remove selected forms (requires confirmation)
- Start Batch Job: Pass selected forms directly to a batch processing run
Example: Search for "Tag: 2023-tax-year", select all 47 results, bulk action "Archive" to clean up the workspace at the start of 2024 filing season.