How to build niche filters and badges with custom fields
Turn a board's job and company custom fields into filter dropdowns and listing badges.
A
JCustom fields let a board describe what matters in its niche: whether a role is identified for a particular community, whether an employer sponsors visas, which clearance a job needs. This recipe turns two of them into filter dropdowns on the job listing page and badges on each job card.
Boards built from the latest starter already add every public single select, multi-select and yes-or-no field to the All filters sheet. Follow this recipe when you want a different layout, such as dropdowns in the main search bar, or when you build the listing page yourself.
The running example is a board for Aboriginal employment in Australia. It has one job field and one company field:
| Field | Belongs to | Type | Options |
|---|---|---|---|
| Opportunity type | Job | Single choice | Aboriginal Identified, Aboriginal Sector, Mainstream (Aboriginal applicants encouraged) |
| Employer type | Company | Single select | Aboriginal Community Controlled Organisation, Aboriginal Owned Business, Government Sector, Corporate Sector, Health, Private |
Use a job field for something that can differ between two jobs at the same employer, such as whether a particular role is identified. Use a company field for something true of the employer, such as its ownership. A company field is set once per company and applies to every job that company posts. Use the wording your community and your board already use for these categories; the labels above follow one board's choices.
Before you begin
- Build the listing route from Build a job listing page. This recipe adds a search function beside its
loadJobs. - You need dashboard access that can manage settings on the board.
Set up the fields in the dashboard
The operator creates both fields once. The frontend reads their definitions at runtime, so a new option shows up without a code change.
The job field. Open Settings → Job form, scroll to Custom fields, and click Add field. Name it "Opportunity type", choose Dropdown (single choice), and add the three options. Every posting form on the board then asks for it.
The company field. Open Settings → Company profile, then in Custom fields click Add field. Name it "Employer type", choose Single select, and add the six options. Turn on Show on public profile: only public fields can be filtered or shown. Turn on Profile owner can edit if employers should choose their own type; leave it off if your team verifies it.
Each option has a label, which visitors see, and a key, which is what gets stored and filtered on. Keys are fixed once saved, so renaming a label later never breaks a saved URL. This recipe assumes keys like these:
| Field key | Option keys |
|---|---|
opportunity_type | identified, sector, mainstream |
employer_type | acco, aboriginal_owned, government, corporate, health, private |
A job field key and a company field key may be the same word. Job search keeps them apart, so type on a job never matches type on a company.
Read the definitions
Job field definitions come from the board context. Company field definitions come from board.profileFields, which returns public fields only, so a private company field can never become a filter option.
If either field is missing, the operator has deleted it or made it private. Hide that dropdown instead of rendering an empty one.
Keep option keys in the URL
The URL holds option keys, not labels, so a shared link keeps working after a label is reworded or translated. Accept only keys the current definition offers; anything else from a hand-typed URL is dropped.
A visitor who picks "Aboriginal Community Controlled Organisation" produces /jobs?employer=acco. Choose URL parameter names that suit your routes; the field keys only matter in the search body.
Render the dropdowns
Each dropdown lists the definition's options in the operator's order, shows the label, and submits the key. Keep a visible label on every control.
"All" is application copy. Translate it with the rest of your interface chrome.
Search with both filters
Send the job field under filters.customFields and the company field under filters.companyCustomFields. Both take a list of clauses with a field key and the accepted values. Clauses are AND-matched and the values inside one clause are OR-matched, so a multi-select dropdown sends one clause with several values.
/jobs?opportunity=identified&employer=acco returns identified roles at community controlled organisations. Job search filters on custom fields in board.jobs.search only; board.jobs.list does not take them.
Each list accepts up to 10 clauses of up to 10 values. A select value is an option key, a yes-or-no field takes true or false, and a number field takes a number. A key that is unknown or private, or an option key the field does not define, is rejected with invalid_filter. That usually means a stale URL after the operator changed the field, so drop the parameter and search again rather than showing an error page.
When a company's employer type changes, its jobs are re-indexed automatically, usually within seconds. You do not need to invalidate anything.
Show badges on job cards
Job cards carry the card-safe custom values (select, yes-or-no, and number fields) for the job in customFieldValues and for its company in company.customFieldValues, keyed by field key. Resolve each stored option key to its current label through the same definitions the dropdowns use.
A value whose option was removed resolves to no label, so the badge disappears instead of showing a raw key. Style badges as secondary information: the job title stays the strongest text on the card.
Verify the recipe
- In the dashboard, set the employer type on two companies that each have published jobs, one to
accoand one togovernment. - Open
/jobs?employer=accoand confirm only the first company's jobs appear, each with an "Aboriginal Community Controlled Organisation" badge. - Change the first company to
government, wait a few seconds, reload, and confirm its jobs have moved to/jobs?employer=government. - Combine both filters and confirm the result matches both.
- Open
/jobs?employer=unknownand confirm the page ignores the parameter instead of failing. - Make the company field private in Settings and confirm the dropdown and its badges disappear.
See the Jobs reference for the full search body and the Profile fields reference for company definitions.