Model Data Changes Actions

These actions cover the actual manipulation of data within a model, including adding or deleting rows, updating fields in rows, and accepting or canceling data changes to the model.

Create new row(s)

Used to create new rows within a single model. (Particularly useful for popups.)

  • Model: The model the action should affect.

  • Place row at…: Determines where the new row is placed within the Skuid model:

    • Start of Model data
    • End of Model data
  • Have associated Components initially show this row in…: When the new row is created, it can displayed in the following modes:

    • Edit mode
    • Read mode w/ inline-editing
  • Rows to use:

    • Rows in context: In this situation, context means any rows selected by the end user.
      • If using this action (with this option) as mass action, a corresponding new row is created for every selected row.
    • None: A single new row is created.
  • Named Outputs: Re-use the output of the created row(s) in subsequent actions via the $Output merge variable. The named output will only be available for subsequent actions in this series or sequence of actions.

    If the name of the output is New_Row, then following actions may access this row(s) using {{$Output.New_Row.<row_number_in_list_of_created_rows>.<field_name>}}.

Add default values [[]]

Use fa-plus-circle Add Default Values on the action item to—as the name implies—add default values to any row created by this action.

After creating the default value,

  • Field: The field to set a default value for.
  • Content: The type of default value set:
    • Single Specific Value: Determines the default value to use within the selected field.
    • None - blank value: Determines that the selected field must be blank. This is commonly used to override model conditions that enforce a specific value on record creation.
  • Value: Enter the default Value for the field.

Note

If the new row (or rows) are created using Rows in context, then use merge syntax in these default values.

Update a field on row(s)

Update a field on any rows in context—or on all rows—with a specified value, the result of a formula, field data from another model, a page/URL parameter value, or a user attribute from the data source’s metadata.

  • Model: The model the action should affect.

  • Field: The field on the model to be updated.

  • Field Value Source:

    • Single specified value:

      • Value: The specific value to place in the field.
    • Result of a Formula: The result of the formula entered in this text area will be placed in the selected field.

    • Field from another model:

      • Source Model: Select the model containing the desired field.
      • Source Field: The field from the source model to place in the selected field.
    • Page/URL parameter value:

      • Parameter: The global page parameter or parameter from the URL to place in the selected field.
    • Salesforce user attribute:

      • Salesforce User attribute: The field from the Salesforce running user attribute to place in the selected field.
    • Data Source user attribute:

      • Data Source: Select the data source.
      • Data Source User attribute: The available data source attribute field the action places in the selected field.
  • Rows to use:

    • Rows in context: In this situation, context means any rows selected by the end user are updated with the value.
    • All rows in model: All rows in the model are updated with the value.
  • Named Outputs: Re-use the output of the updated field in subsequent actions via the $Output merge variable. The named output is only be available for subsequent actions in this series or sequence of actions.

Mark row(s) for deletion

Used to mark one or more rows for deletion within a single model. This does not automatically delete data. Rows marked for deletion must be saved or cancelled, which may occur through end user input, or through the Save Model changes action and Cancel Model changes action.

  • Model: The model the action should affect.
  • Rows to use: Select whether this action removes:
    • Rows in context: In this situation, context means any rows selected by the end user.
    • All rows in model: All rows in the model are marked for deletion.

Unmark row(s) for deletion

Used to unmark one (or more) rows for deletion within a single model.

  • Model: The model the action should affect.
  • Rows to use: Select whether this action removes:
    • Rows in context: In this situation, context means any rows selected by the end user.
    • All rows in model: All rows in the model are unmarked for deletion.

Unmark all rows for deletion

Used to unmark all rows for deletion. In contrast to “Unmark row(s) for deletion,” this action can be used to unmark rows in multiple models.

  • Models: One (or more) models this action should affect.

Remove all rows from Model

Used to completely empty the loaded rows in one or more models. This does not delete data, but rather unloads data from the page. In contrast to Remove row(s) from Mode l, this action can be used to clear multiple models.

  • Models to Empty: One (or more) models this action should affect.

  • Named Outputs: Re-use the output of the abandoned row(s) in subsequent actions via the $Output merge variable. The named output will only be available for subsequent actions in this series or sequence of actions.

    If the name of the output is Abad_Rows, then following actions may access this row(s) using {{$Output.Abad_Rows.<model_id>.<row_number_in_list_of_abandoned_rows>.<field_name>}}.

Remove row(s) from Model

Used to remove one or more loaded rows in one individual model. This does not delete data, but rather unloads data from the page. In contrast to Remove all rows from Model, this action provides more granular control to remove specific rows within context.

  • Model: The model the action should affect.

  • Rows to use: Select whether this action removes:

    • Rows in context: In this situation, context means any rows selected by the end user.
    • All rows in model: All rows in the model are removed.
  • Named Outputs: Re-use the output of the abandoned row(s) in subsequent actions via the $Output merge variable. The named output will only be available for subsequent actions in this series or sequence of actions.

    If the name of the output is Abad_Rows, then following actions may access this row(s) using {{$Output.Abad_Rows.<row_number_in_list_of_abandoned_rows>.<field_name>}}.

Cancel Model changes

Use this action when to prevent edits to data from being saved to the Model.

  • Models to Cancel: The model the action should affect.

Note

Use this action when creating multiple Model changes to ensure data integrity. Why?

Imagine that a user is working on a page and makes a few edits.

They then initiate an Action Framework trigger (for example, a button or a Row Action) that starts a series of actions. One of those actions is Save Models. This means that all the changes—including those made before the user initiated the action trigger—are saved.

Don’t want those earlier updates included in the Save Models action? Then start the action script with Cancel Model changes: this removes all pending changes started before the user activated the Action Framework trigger. Only those changes added after the trigger was selected by the user are saved.

Save Model changes

Save one (or more) Models

  • Models to Save: The model(s) the action saves.
  • Roll back entire save on any error: Check this to rollback any changes made before the error occurred in the save process. This prevents data synchronization issues when a new record (or a partial edit of a record) causes new data to mix with old.

Note

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

Adopt rows into Model

This action transfers rows from a source model into a target model.

  • If the rows adopted from the source model match rows that already exist within the target model, the target model’s rows are updated to match those in the source model.
  • If the rows being adopted do not exist within the target model, then they are added to the model.

This action can be used to adopt saved rows, but it may also be used before saving the source model. Doing so adds any row changes (or new rows) to the target model in Edit mode.

  • Source Model: Select the model to obtain rows from.

  • Target Model: Select the model where rows should be sent and adopted.

  • Rows to Use: Select whether this action sends:

    • Rows in context: In this situation, context means any rows selected by the end user.
    • All rows in model: All rows in the model are sent.
  • Named Outputs: Re-use the output of the adopted row(s) in subsequent actions via the $Output merge variable. The named output will only be available for subsequent actions in this series or sequence of actions.

    If the name of the output is Adopt_Rows, then following actions may access this row(s) using {{$Output.Adopt_Rows.<row_number_in_list_of_abandoned_rows>.<field_name>}}.

Note

This action does not require the use of a follow-on Query Model action.

Warning

Adopting rows from one data object to a different data object often fails or causes unexpected behaviors.