Model Conditions / Querying Actions

This group includes actions that limit the data displayed on the page or load more data into the page. Many govern model conditions, which can be paired with query actions to refresh the data after updating those conditions. There are also actions for searching and sorting models.

Activate & Set value of Model Condition

This action sets the value for a mode condition and then activates it.

Note

To display new data after conditions have been deactivated, use in conjunction with the Query Model or Query Models actions.

  • Model: The model which has the condition.

  • Condition: The name of the condition to activate.

    Note

    There must be a condition on the designated model for this action to function.

  • Value: The value for the model condition. (Use the Field Picker to easily select a field’s value through merge syntax.)

Activate Model Condition

Activates an existing, inactive model condition with a state that was set to Filterable Default Off. This action can also activate a condition that has been turned off by a previous Deactivate Model Condition action.

Note

To display new data after conditions have been deactivated, use in conjunction with the Query Model or Query Models actions.

  • Model: The model which has the condition.

  • Condition: The name of the condition to activate.

    Note

    There must be a named condition on the designated model for this action to function. Only conditions with the state set to Filterable Default On or Filterable Default Off can be given a Condition Name.

Deactivate Model Condition

Deactivates an existing, active model condition with a state that was set to Filterable Default On or Always On. This action can also deactivate a condition that has been turned on by a previous Activate Model Condition action.

Note

To display new data after conditions have been deactivated, use in conjunction with the Query Model or Query Models actions.

  • Model: The model which has the condition.

  • Condition: The name of the condition to deactivate.

    Note

    • There must be a named condition on the designated model for this action to function. Only conditions with the state set to Filterable Default On or Filterable Default Off can be given a Condition Name.
    • Because of some differences under the hood, unchecking an item in a filter does not trigger the event associated with Deactivate Model Condition. Therefore, when a filter is unchecked at runtime, any actions listening for that event will not run.

Deactivate Filterable Model Conditions

Deactivates all model conditions set as Filterable Default On or Filterable Default Off on one (or more) models.

  • Deactivate Filterable Conditions on: Then name of the model(s) to deactivate conditions on.

Note

  • To display new data after conditions have been deactivated, use in conjunction with the Query Model or Query Models actions.
  • Because of some differences under the hood, unchecking an item in a filter does not trigger the event associated with Deactivate Filterable Model Conditions. Therefore, when a filter is unchecked at runtime, any actions listening for that event will not run.

Query Model

Following a prior action (such as Activate Model Condition), Query Model queries the object that the selected model is attached to. As a result, updated data displays across all components attached to the selected model.

Note

Using the Save Model Changes action in an action script? No need to query the model afterward; data updates display in all components linked to the model after the Save is triggered.

  • Model: The model to query.

  • Query Behavior:

    • Standard - Completely Replace Data: Overwrites the data in the model with the new data received by the query.
    • Get More - Merge in new Rows with old: Leaves the existing data in the model, but adds any new records found by the query.
  • Named Outputs: Re-use the output of the query in subsequent actions via the $Output merge variable. The output of a model query will be the modified or new rows returned in the query. The named output will only be available for subsequent actions in this series or sequence of actions.

    If the name of the output were Q_Rows, then following actions may access these rows using {{$Output.Q_Rows.<row_number_in_returned_results>.<field_name>}}.

Note

To display a message if there is a problem with the query, click fa-plus-circle Add on-error Action. Create an error Message and select a Timeout (seconds) to determine how long the message displays.

Query Models

Like Query Model, Query Model queries the objects that the selected models are attached to. As a result, updated data displays across all components attached to the selected models.

  • Model to Query: Select models to query.
  • Query Behavior:
    • Standard - Completely Replace Data: Overwrites the data in the model with the new data received by the query.
    • Get More - Merge in new Rows with old: Leaves the existing data in the model, but adds any new records found by the query.
  • Named Outputs: Re-use the output of the model(s) query in subsequent actions via the $Output merge variable. The output of a model(s) query will be the modified or new rows returned in the query. The named output will only be available for subsequent actions in this series or sequence of actions.

If the name of the output were Q_Rows, then following actions may access these rows using {{$Output.Q_Rows.<model_id>.<row_number_in_returned_results>.<field_name>}}.

Note

To display a message if there is a problem with the query, click fa-plus-circle Add on-error Action. Create an error Message and select a Timeout (seconds) to determine how long the message displays.

Search Model

Searches all text fields for a specific text string. This action is the only way to immediately filter by a text string other than having users search within a Search or Table component. It requires no conditions to be set or activated to function.

When this action runs, the model’s text fields are searched, and the model requeried, displaying only the rows of data that match the search text string.

Note

Searches are not tokenized, which means that if the search text contains multiple words, Skuid only returns results that match the exact text (in that order) in the search text field. An untokenized search for “George Washington” returns only records with “George Washington” exactly, not records with “George” and “Washington”, “George Michael Washington,” and “Washington, George.”

  • Model: The models to search.

  • Search Text: The text string to search with.

    Note

    Search Text is compatible with merge syntax.

Sort Model

Sorts a model by a specific field. This sorting will apply to all components connected to the model.

Note

This action will override any sort commands within the model’s Fields to order records by property.

  • Model: The model to be sorted.
  • Field: The field to sort by.
  • Sort Behavior: Determines how the sort is applied:
    • Cycle Sort: Cycles through all sorting methods, looping in the following order: Ascending > Descending > None
    • Ascending: Records of higher “value”—alphabetically or numerically—appear at the bottom of the record list.
    • Descending: Records of higher “value”—alphabetically or numerically—appear at the top of the record list.
    • Clear Sort: Any sort applied to the model, including on applied by a model property, is cleared.
  • Sort Client Side: Determines whether the sorting is done on the client or server side. When enabled, only the rows that currently exist within the model are sorted (client side). This contrasts with sorting on the server side, where all records in the object are queried and sorted on the server by the selected field.
  • Query After Setting Sort: Determines whether a model should immediately requery and display newly sorted data or not. Unless there are more model data actions to be performed, it is typically recommended to leave this property enabled.