Skip To Content

Get, copy, and calculate attributes

A task step can be configured to get, copy, and calculate the attributes of layers and tables in the active step view. Attribute actions for a step are configured on the Actions tab in the Task Designer pane. The step must be selected in the Tasks pane for the Actions tab to be available.

A task step can do the following:

  • Get an attribute from the task user.
  • Copy and save the attributes of a selected feature or record.
  • Calculate the attributes of selected features or records using the field calculator.

Get attributes

A task step can be configured to get and save attributes provided by a task user. The attributes are saved in a variable that can be used in subsequent steps. For example, the task user provides an attribute that can later be used to attribute multiple features created in the task.

Get attributes is configured as a step command. When the step is run, the step displays an attribute field, prompting the task user to enter an attribute.

Get an attribute from the user
Get an attribute from the user

Tip:

The task user can hover over the attribute field name to view the attribute field properties.

To configure a step to get attributes from the task user, click Options in the Tasks pane and click Edit In Designer .

  1. In the Tasks pane, expand the task and choose the step you want to configure.
  2. Click the Actions tab in the Task Designer pane.
  3. Click the Edit icon Editable on the command action bar and choose Get Attributes under Type of Command.
  4. Click Add Attribute to define an attribute to get from the task user.
  5. On the pop-up dialog box, define the attribute properties as follows:
    • Choose the table that contains the attribute field for which the user will provide a value.
    • Choose the attribute field for the user-provided value.
    • If necessary, enter a preset value. A preset value can provide a prefix for the entered attribute value; for example, all attributes in the field start with 101.
    • Enter a ToolTip. The ToolTip is displayed when the user hovers over the attribute field text box. A ToolTip can be used to provide more information about what attribute value the user should enter.
    • Enter a variable name. The variable is used to store the attribute value provided by the user and is available for the Calculate Field step action.
  6. Click Add to store the attribute.

    Tip:

    Click Add Attribute to define multiple attributes to get from the task user in the same step.

  7. Click Done to go back to the Actions tab.

Copy attributes

A task step can be configured to copy one or more attributes from a single, selected feature or record. The copied attributes are saved into a variable that can be used by subsequent steps. A step can use the saved attributes to calculate other attribute fields. For example, copy and store an attribute and use it to calculate the fields of new features created in the task. Attributes can be copied from a currently selected feature or record, a newly created feature in the task, or a feature that has been modified in the task. Attributes can also be copied from a feature in a saved selection.

To configure a step to copy attributes, click Options in the Tasks pane and click Edit In Designer.

  1. In the Tasks pane, expand the task and choose the step you want to configure.
  2. Click the Actions tab in the Task Designer pane.
  3. Click the Add Action drop-down menu under When starting the step, Prior to command execution or When exiting the step and choose Copy Attributes.
    Tip:

    You can configure multiple actions for a single step.

  4. Choose the feature or record from which to copy the attributes under Copy attributes from.
  5. Choose the attribute table under From Table.
  6. Click Add Attribute to choose the attribute field to copy.

    Enter a name for the variable that will store the copied attribute.

  7. Click Add Attribute to copy another attribute or click Done to return to the Actions tab.

Copy attributes when starting the step

A task can copy attributes when a step starts. For example, copy and store the attributes of the footprint created in an earlier step and use them to calculate the fields of other building footprints created in the step.

Copy attributes before step starts
Copy attributes before step starts

Copy attributes prior to command execution

A task can copy attributes after the step has started but before the step command executes. For example, when the step starts, clear the current selection and select the building footprint that was created earlier in the task. Before the step command executes, copy and store the attributes from the selected building footprint.

Copy attributes before command executes
Copy attributes before command executes

Copy attributes when exiting the step

A task can copy feature attributes when the step completes, such as in the following workflow:

  1. The first step runs the Create command that is used to create a building footprint.
  2. The second step opens the Attribute window, and the task user enters a new attribute in the AssetNumber field. The attribute value is copied and saved to a task variable.
  3. The third step runs the Duplicate Vertical command that adds floors to the building footprint. At the end of this step, the AssetNumber field of the new floors is calculated with the saved attribute value entered in the previous step.

Calculate attributes

A task step can use the Field Calculator to calculate the attributes of features or records in the active step view. A step can calculate the attribute fields of currently selected features or records, features or records in a saved selection, newly created features or records, and features modified in the task. A step can use the field calculator to perform the following field calculations:

  • Calculate field values to the values of another, available attribute field.
  • Calculate field values to a value you specify.
  • Calculate field values to the value saved in a task variable.
  • Perform advanced calculations using Python code blocks.

Field Calculator for Task Designer
Field Calculator for Task Designer

To configure a step to calculate attribute fields, click Options in the Tasks pane and click Edit In Designer.

  1. In the Tasks pane, expand the task and choose the step you want to configure.
  2. Click the Actions tab in the Task Designer pane.
  3. Click the Add Action drop-down menu under When starting the step, Prior to command execution, or When exiting the step and choose Calculate Field.
    Tip:

    You can configure multiple actions for a single step.

  4. Choose the features or records for which to calculate attribute fields under the Input Selection drop-down menu.
  5. Choose the attribute table under Input Table.
  6. Choose the attribute field that will be calculated under Field Name.
  7. Use the Field Calculator to define how the attribute field is calculated.
  8. Click Done to return to the Actions tab.

Calculate field when starting the step

A task can calculate attribute fields when a step starts. For example, when the step starts, calculate the attribute field of a saved selection using an attribute value provided by the user in the previous step.

Calculate field
Calculate field

Calculate field prior to command execution

A task can calculate attribute fields after the step has started but before the step command executes. For example, when the step starts, clear the currently selected features. Before the step executes a command, calculate the attribute field of features in previously saved selection. The step executes a geoprocessing tool that will use the features in the saved selection.

Calculate field before command execution
Calculate field before command execution

Calculate field when exiting the step

A task can calculate attributes when the step completes. For example, when the step completes, the field calculator is used to calculate attribute fields of the features created in the step.