Customizing Dataset Record Search Criteria with Index and Header Rules

Prev Next

πŸ”‘ Required permission: Rules Editor

A dataset record's index determines which values users can search for to find the record. Its header determines the identifying information that appears with the record's name in search results. Together, they help users find records and tell similarly named records apart.

By default, dataset records are searchable by name and key, and only the record's name appears in search results. Use an Index/Header rule to add search values, such as a location or a former name, and to display them as the record's header.

Omni Search results for an organization, showing the header (city, state, and former name) below the record name

Unlike person records, which use separate Index and Header rules, each dataset in your database gets its own combined Index/Header rule: any value you add is both searchable and displayed. If your database has multiple datasets, create a separate rule for each one.

The index and header appear in Omni Search results and in form autosuggest lists.

A lookup results list with Name and Data columns, showing each organization's city and state, and one record's former name, in the Data column

πŸ“– Further reading

πŸ”Ž Looking to customize person records?

Person records use separate Person Index and Person Header rule types. That way, a broad set of values is searchable while the header shows only what your team needs. See Customizing Person Record Search Criteria with Person Index/Header Rules.

Creating the rule

Dataset index and header values can't be changed manually. Set them using rules instead.

πŸ“ Note

Standard datasets delivered with your Slate database, such as Organizations or Funds, may come with their own Index/Header rules. Check Database β†’ Rules before creating a new rule. If one exists, edit it rather than starting from scratch.

To create an Index/Header rule:

  1. Go to Database β†’ Rules.

  2. Select New Rule.

  3. Configure the following settings:

    • Name: Enter a descriptive name, such as Organizations Index/Header.

    • Type: Select Configurable Joins.

    • Category: Select Records.

    • Base: Select the dataset the rule applies to, such as Organizations.

    • Rule Type: Select Index/Header.

    • Folder: Select a folder to keep rules organized. Select Other and enter a name to create a new folder, if needed.

    • Exclusivity Group: Set automatically to Index/Header. Slate places dataset Index/Header rules in this Exclusivity Group, so only one Index/Header rule can apply to a record at a time.

    • Non-deterministic: Leave it set to Rule is deterministic and has an exclusive priority.

    • Priority: Enter a whole number, such as 1, if this is the dataset's only Index/Header rule. If you create multiple rules of the same type, see Multiple index/header rules.

    • Status: Select Inactive.

  4. Select Save.

The New Rule dialog for an Index/Header rule, showing the Exclusivity Group set to Index/Header and Status set to Inactive

Configuring the rule

  1. In the Action section, set Action to Replace Values from Formula.

  2. (Optional) Add filters if the rule should update only some records. Otherwise, leave the Filters section empty so the rule applies to all records in the dataset. If some records need different values, see Multiple index/header rules.

  3. Add a subquery export and configure its settings:

    • Name: Enter a name, such as Index and Header.

    • Output: Select Concatenate to combine multiple values into one string.

    • Export Separator: Enter a separator, such as a comma followed by a space (, ). The separator appears only between values that exist, so the header never starts or ends with a stray comma.

    • Exports: Add the values to search by or display. Add Literal exports for fixed text or a new line (\n).

  4. Select Save.

  5. In Formula, type @ and select the subquery export from the list.

  6. Select Save.

πŸ“ Note

Because datasets use a single, combined Index/Header rule, any formatting you add is also searchable. A literal like β€œFormer Name:” becomes a searchable term.

For a complete example that applies these steps to organization records, see Organizations Dataset & Index/Header Rules.

Testing and activating the rule

⭐ Best practice

Index and header rules change how every user searches for records in this dataset. Test the rule in your test environment before activating it in production.

πŸ”” Work in test is lost when re-provisioning

Ask any colleagues who might be using your test environment before re-provisioning. If they've been working on something in test that hasn't been copied to production, that work will be lost.

Test the rule in your test environment before activating it in production:

  1. Move the rule into your test environment. Use Suitcase to copy the rule to test, or re-provision your test environment to use a current database snapshot which includes the rule.

  2. In your test environment, select Edit on the rule, set the Status to Active, and select Save.

  3. Run a Retroactive Refresh on a small set of records to queue them for rule evaluation.

  4. Open one of the records.

  5. Select the Preview pending actions link at the top of the record. It appears when the record has recently been queued for rule evaluation.

  6. On the Preview Actions screen, select Display.

  7. After the preview loads, select Force premature rule execution. This runs the rule on the record immediately, instead of waiting for the next scheduled execution.

  8. Verify the results:

    • Confirm the header by looking up a record in the Omni Search. The text below the record's name updates with the new information.

    • Confirm the index by searching for a value only your rule adds, and confirm the record appears in the results. Name and key remain searchable regardless.

  9. When the test results are correct, activate the rule in production:

    • If you changed the rule while testing, copy it back to production with Suitcase and select Merge Existing so the production rule is updated rather than duplicated.

    • In your production database, select Edit on the rule, set the Status to Active, and select Save.

    • Run a Retroactive Refresh so the rule runs on records that already exist. Rules run when a record changes, not when a rule changes, so existing records keep their current values until they're queued.

Multiple index/header rules

Add filters to your rule if some records should have different index or header values than others. Each variation requires its own Index/Header rule. This isn't common, but it may help when departments share a dataset. See Exclusivity Groups for how priority determines which rule applies.

Rules never combine: each record gets its index and header from a single rule, the highest-priority rule whose filters it matches. To add or change values for all records, edit the existing rule's exports. Creating a second rule doesn't add values to the first.

Still looking for what you need?