Model Conditions

Model conditions determine the appearance of data, by limiting the records that are pulled into a model from the external system. They tell models which data to request (or not request) by checking fields specified in the condition against parameters and values also specified. Model conditions essentially filter content before it is pulled into the model.

Use conditions to pull in and display a single record, like that on a detail page. Or use conditions to filter which records are shown within a Table component. Conditions can effectively filter data on the fly: when set to Filterable default off, conditions wait to receive values from the component; these values then trigger the condition to filter the data.

Create a Condition

Note

You can create more than one condition on a model. Each condition will be numbered.

  1. In the Elements pane, click the Models tab.
  2. Click the model name.
  3. Below the model name, click Conditions:
  4. Click add Add to create a new model condition.
  5. Click Save.

Configure the condition

Configuration is where the magic happens for model conditions. The tools?

  • the Field
  • the Operator
  • the Value
  • the State

(To learn more about these model properties, see Properties.)

Here’s how it works:

  1. The model calls data from the external system and displays it on any associated components on the page.

  2. When there’s a condition applied to the model, the model pre-filters the data before displaying. The filter consists of a value on a field.

    Here’s an example: The company has many client accounts across the world. But Jamie only handles accounts located in the Western United states; she doesn’t need to see all company accounts, only those in California, Oregon, and Washington.

    The condition would filter the account’s billing address (or even the billing) state field for three values (WA, OR, and CA), and only bring account data into the page that matches that criteria.

Create and configure a sub-condition

You can also create conditions on conditions (sub-conditions) when a greater level of filtering is desired.

Note

The original condition must be defined before creating the sub-condition.

  1. Click the previously created model condition.
  2. Click add Add a sub-condition to create a new subcondition to the parent condition.
  3. Configure the condition.
  4. Click Save.

Properties

  • Grouping logic: By default, when a model has multiple conditions (each of which will be numbered), all conditions are applied. Grouping Logic allows the builder to determine how to group and apply multiple conditions when loading the model.

    For example, in a model with 4 model conditions: ((1 AND 2) OR (3 AND 4))

    Warning

    Using Grouping Logic can complicate the application of filters, so best practice is to leave this property blank unless you actually need to apply this logic.

  • Field: The field in the current model to use as a filter. Select using field picker.

  • Operator: The relationship between the field and its value. Standard Skuid operators are used.

  • Value: The specific content used by the condition to filter the data.

    Note

    Some content options are not available for every external service.

    • Content:

      • Single specified value: The condition only returns records that meet the specified value.

        • Value: The value that triggers the condition.
      • Multiple specified values: The condition returns records that meet at least one of the several specified values.

        • Values: Values that triggers the condition.
      • Field from another model: Use a field from another model as the condition. This condition links models by setting up a relationship between their fields. There must be at least two models on the page to utilize this content type..

        • Source model: The name of the model.
        • Source field: The field on the source model.
        • If no row in source model, then…
          • Deactivate this Condition
          • Abort this Model’s Query
      • Page/URL parameter value: Returns records that meet the specified page or URL parameter (for example, an id parameter, often designated as id=xxxxxxxxxxxx in the page’s URL).

        Note

        This type of condition is required to use a Skuid pages as an override for the Salesforce View, Edit, or Clone actions.

        • Parameter: Indicates the specific parameter to filter by.
        • If this parameter is not provided, then …
          • Set its value to Blank
          • Deactivate this Condition
          • Abort this Model’s Query

        Note

        This condition is commonly used to pass a record’s id into a page or page component. For example, on a detail page that shares information on an account—but also displays that account’s contacts and new opportunities—use this condition on the account, contacts, and opportunities models to ensure that Skuid only displays a single account—and only the contacts and opportunities that are related to it.

      • Skuid user attribute / Data source user attribute: Returns records if the value of a field on the model matches the value of a field on the current user’s record in Skuid or in their external system.

        • Skuid user attribute: The value on the current user’s record that triggers the condition (usually an ID property). Options include:
          • Default currency
          • First name
          • Last name
          • Email
          • Locale
          • Name
          • Organization ID
          • Organization name
          • Profile ID
          • Profile name
          • Session ID
          • User ID (default)
          • User name
          • Use role ID
          • User type
          • Is multi currency org
      • Data source user attribute: The value on the current user’s record that triggers the condition. Options include:

        • First name
        • Last name
        • Email
        • Full name
        • User ID
        • User name
      • None - blank value: Returns records where the specified field is blank/null.

      • Result of subquery: Create a condition that simulates sub-conditions in SOQL (a semi-join sub-select). For an example, see Limit Records with a Subquery Condition.

        • Join object: The object to join. For example, Case in this argument: WHERE ID in (SELECT ContactId FROM Case).
        • Join field: The field to join. For example, ContactId in this argument: WHERE ID in (SELECT ContactId FROM Case).
        • Subcondition logic: Like Grouping Logic (see above), Subcondition logic allows the builder to determine how to group and apply multiple sub-conditions.
  • State:

    • Condition state: This determines whether the condition is activated or deactivated.

      • Always on: This condition is always on and cannot be turned off.
      • Filterable default on and Filterable default off: The condition can be turned on and off using a filter or action.
        • Condition name: The filterable default condition’s label displayed in filters and actions that alter conditions.
      • Always off: This condition is always off and cannot be turned on.