Dataset Index/Header Rules - Customizing Dataset Record Search Criteria

Users can search for dataset records in numerous places, such as in the top right search box of Slate or on a form using an autosuggest list for its dataset. By default, users can find dataset records by their:

  • Name
  • Key

 

mceclip0.png

Users may want to make dataset records searchable by values, in addition to showing information for other values. Users can customize this search using a dataset index/header rule. For instance, the above example demonstrates how Slate can show additional attributes about the dataset record, like its location and former name (which is a custom field).

The index/header information also appears when users click "Continued..." in an autosuggest list. The information is displayed in the "data" column:

mceclip0.png

Step 1. Create the Rule
  1. Navigate to the Rules tool inside of Database.
  2. Click "New Rule"
  3. Enter a "Name".
  4. Select the "Configurable Joins - . . ." option for the Base setting that corresponds to the dataset you are building the rule for.
  5. Select "Index/Header" for the Type.
  6. Specify a "Folder", if desired.
  7. Set a "Priority", such as "1" if this is your only dataset index/header rule.
  8. Set "Status" to "Preview".
  9. Click "Save".
  10. Adjust the "Action" setting to "Replace Values from Formula"

mceclip1.png

Step 2. Configure the Rule
In the "Action" section, your next steps are to add one or more exports that will be used to search records by, and then reference them in the "Formula" setting. Optionally, you can add filters to your rule if some records should have different index criteria than others (this is not common).

We've outlined an example below for organization records. 

Organization Record Example

In this example, we are looking to:
  • Show address information. If the organization is in the United States, we want to output its city and state. If the organization is not in the United States, we want to output its city and country.
  • Show its former name. We've created an organization-scoped field that allows us to enter the former name of an institution. By showing this, users can more easily find their school. Instead of using a field for storing an organization's former name, you can also store and use something like its aliases; for instance, allowing users to find George Washington University by storing "George Washington, GW, GWU" in this field

1. Join from "Organization" to "Address by Rank Overall" and enter "1" for the "Rank" setting. This will grab the overall rank 1 address for the dataset record.

2. Add a subquery export.

3. Specify a "Name", like "Index and Header".

4. Select the "Output" setting of "Concatenate".

5. Add the "City" export from the "Field Values" join.

6. Add a literal export with the "Name" and "Literal" settings of ", ".

7. We want to output the address' state if it is in the United States; otherwise, we want to output the country. To do that we:

    1. Add a subquery export that uses (a) the "Region" export and (b) the "Country" filter set to IN "United States". Slate will only return a value in this subquery export if the address is in the United States.
    2. Add another subquery export that uses (a) the "Country" export and (b) the "Country" filter set to NOT IN "United States". Slate will only return a value in this subquery export if the address is not in the United States.

mceclip1.png

mceclip3.png

 

8. We want to output a new line that contains the former name of an organization if the organization has one. In our example, we are storing the former name of a school using a custom organization-scoped field. To do that we:

    1. Add a subquery export
    2. Add a literal export with the "Literal" setting of "\n" for a new line
    3. Add a literal export with the "Name" and "Literal" settings of "Former Name: "
    4. Add an export for the former name
    5. Add a subquery filter with (a) the "Aggregate" setting of "Exists" and (b) the former name export. Slate will only return a value in this subquery export if the organization record has a value in the former name field

mceclip4.png

mceclip5.png

mceclip6.png

 

9. Reference the "Index and Header" subquery export in the formula.

10. Save the rule.

 

mceclip0.png

Step 3. Activating the Rule
  1. Activate the rule.
  2. Perform a Retroactive Refresh.

  Tip On the Tables

Slate stores the person index on the [dataset.row] table in the [index] column, [dataset.row].[index].

Was this article helpful?
2 out of 4 found this helpful