How to Create user filter from expression rule

I am trying to create a user filter with the results from an expression rule which displays distinct options from my table.

I have researched the documentation, and was unable to find any answers with an example. 

How do I call the expression rule to populate the options for this user filter based on the results from the expression rule I have created?

Many thanks in advance for your assistance.

  Discussion posts and replies are publicly visible

Parents Reply
  • Here is the "manually entered" user filter list, which is pre-determined options and values. 

    I want this to be dynamic, based on the DISTINCT values from the OutcomeStatus column. 

    The reason? Because if the data changes, I don't have to go into the filter and make changes. 

    Below is the working filter, but it's NOT dynamic. How do I query the DISTINCT values of the recordType in this expression?

    =a!recordFilterList(
      name: "Status",
      options: {
        a!recordFilterListOption(
          id: 1,
          name: "In Production",
          filter: a!queryFilter(
            field: 'recordType!{793e655d-96f3-490d-9594-62845dbe1ad3}AP Health Application.fields.{8fcf0830-0ea7-4f5a-99a5-b57339b716f0}OutcomeStatus',
            operator: "=",
            value: "In Production"
          )
        ),
        a!recordFilterListOption(
          id: 2,
          name: "Decommissioned",
          filter: a!queryFilter(
            field: 'recordType!{793e655d-96f3-490d-9594-62845dbe1ad3}AP Health Application.fields.{8fcf0830-0ea7-4f5a-99a5-b57339b716f0}OutcomeStatus',
            operator: "=",
            value: "Decommissioned"
          )
        ),
        a!recordFilterListOption(
          id: 3,
          name: "Retired",
          filter: a!queryFilter(
            field: 'recordType!{793e655d-96f3-490d-9594-62845dbe1ad3}AP Health Application.fields.{8fcf0830-0ea7-4f5a-99a5-b57339b716f0}OutcomeStatus',
            operator: "=",
            value: "Retired"
          )
        ),
        a!recordFilterListOption(
          id: 3,
          name: "Under Evaluation",
          filter: a!queryFilter(
            field: 'recordType!{793e655d-96f3-490d-9594-62845dbe1ad3}AP Health Application.fields.{8fcf0830-0ea7-4f5a-99a5-b57339b716f0}OutcomeStatus',
            operator: "=",
            value: "Under Evaluation"
          )
        )
      },
      defaultOption: "",
      isVisible: true,
      allowMultipleSelections: true
    )

Children