Skip to main content
Documentation - HPE Usage and Analytics

Actions in SmartTags rules

Actions modify the rows of data selected by a condition in a SmartTags rule. For each action, you select one or more fields to be modified.

For information about the conditions that trigger actions, see Conditions in SmartTags rules.

CAP_smarttags_rule_action.PNG

Defining fields in an action

Within an action you can define one or more specific fields. When the action is triggered, all fields defined in your action are modified. If a field you want modified does not already exist in your collected data, click Create New Field next to the Field drop-down list.

CAP_data_fields_create.png

You can define multiple actions for a rule, but only one of any specific type.  For example, you can define only one Truncate field action in a rule, but that action can truncate one or more fields.

By default, each action has only one field defined. To add another field to an action, click Add New.

To delete or edit the action, clear the check box and then click Delete.

Action types in SmartTags rules

You can define one or more of the following actions in a SmartTags rule.

Truncate field

This action truncates the values of the specified field to the specified length. You can truncate only tag fields and fields you add manually to HPE Consumption Analytics portal. You cannot truncate fields collected from your data sources.

For example, if you added a Location field, you could create an action that truncates its values to 20 characters.

CAP_smarttags_rule_action_truncate.PNG

For more information about fields, see Fields and field packages

Split field

This action creates new sequentially-numbered fields by splitting the value of an existing field by specified delimiters.

For example, you can split the Account Owner field into First Name and Last Name fields.

CAP_smarttags_rule_action_split1.PNG

 

If you need to create a custom field, you can add it by clicking the + icon to the right of the field name you entered.

Set field to value

This action sets the value of the specified field to a constant value.

For example, you can set the value of a field to Unknown after a condition that triggers when that field contains no value.

CAP_smarttags_rule_action_set_value.PNG

Set field from fields

This action sets the value of a new or existing field. The value is constructed from the values of one or more source fields.

For example, you could extract the first three characters of the Name field, and put that value in a new Domain field.

CAP_smarttags_rule_action_from_fields.PNG

 

To view more options, click Advanced View.  The Advanced View dialog box displays:

CAP_smarttags_rule_action_from_fields2.PNG

In the Advanced View dialog box, you can: 

Field Description
Target Field Select the target field you want to extract information from. For example, Department Name.
Prefix Enter the prefix you want to add. For example, in the image above old is added to the beginning of the new field. 
Source Field Select the source field you want to use to populate the target field. For example, Business unit.
Start Position Select the start position, for example, 1.
Length Select the length of characters to use. 
Padding Type

Select the padding type you want to add to the field: 

  • None - No padding.
  • Leading - Padding before the field to achieve a specific length.
  • Trailing - Padding at the end of the field to achieve a specific length.
Padding Character

Enter the padding character, for example, space or dash characters.

Source RegEx

Enter the regular expression you want to use. For example:

.*resourceGroups\/(.*)\/providers.*

You must:

  • Include a group to extract a value from the Input Field. The group is used to extract the data from the Input Field.
  • Enter the Start Position and Length values to extract the resulting value after the regular expression is performed.
  • Set the Length value to zero to use all of the extracted regular expression capture group.
Suffix Enter the suffix to add to the end of the field.

To return, click Simple View.

Set field from lookup

This action finds the value of a source field in a lookup, and sets the value of a new or existing target field to the target value in the lookup.

For example, if you have the Department Name field in your collected data, and you want to add the associated Business Unit, a rule could find the department in a lookup containing the mapped values, and then set a field value to the corresponding Business Unit.

CAP_smarttags_rule_action_overlay.PNG

To find and retrieve data from a lookup, enter the following information:

Field Description
Lookup Field The starting point in your collected data. For example, {prod_ccs}} might have collected the Department Name field from your Azure cloud.
Select a lookup table The name of the lookup containing the mapped value you want to retrieve. For example, the Department to BU lookup maps all departments to their business units using 2 columns, Department and BU.
Search Column The column in the lookup you want to search for the Lookup Field you specified. This field is used as a key to associate rows in your collected data with rows in the lookup. For example, since you have departments in your collected data, select the Department column from your lookup.
Value Column The column in the lookup containing the mapped value you want to retrieve. For example, the lookup has business units listed in the BU column. For each Department Name value in your collected data that has a matching value in the Department column of your lookup, HPE Consumption Analytics portal will retrieve the corresponding value from in the BU column of your lookup.
Update Value in Field The field in HPE Consumption Analytics portal to update with the value retrieved from the lookup. For example, you might want values from the BU column entered into your data in a Business Unit field. If this field does not already exist, click Create New field to create a new field.
If lookup is not found Toggle between Do not set and Set to Default. Set to Default requires a default number. 

For more information about lookups, see Working with Lookups.

 

Convert field to lower/upper/title case

This action converts the case of the specified field to either upper case, lower case, or title case.

For example, you might want to use all capital letters for the Cost Center field:

CAP_smarttags_rule_action_convert.PNG

Set field to calculation

This action sets the specified integer field to a value determined my a mathematical expression you build. HPE Consumption Analytics portal validates your expression as you build it. If the expression is valid, the expression builder box turns green. If the expression is not valid, the expression builder box turns red and the number of errors display. For example, as a simple calculation you could convert MB to GB by setting the value of a GB field to an expression based on a MB field.

CAP_smarttags_rule_action_calc.PNG

To add fields, click the Field button. To add numbers, click the Value button.

If you need to create a custom field, you can add it by clicking the + icon to the right of the field name you entered.

Use the function menu to:

  • Select a function that enables you to find the minimum value in a set of numbers and field values.
  • Select the maximum value in a set of numbers and field values.
  • Select round, round up, and round down field values from 0 to 8 decimal places.

For example, you might want your calculation to include a Rate value that is no greater than 30:

CAP_smarttags_rule_action_calc_fx.PNG

To do this, from the function menu:

  1. Select min(1,2,3,...).  
  2. In the Function dialog box, click Field and then select Rate.
  3. Click Value and enter 30. This creates a set of values that includes 30 and all values collected for the Rate field. The calculation will use the minimum value from that set.

To nest an expression within an expression, use parentheses.

 


Path navigation

If you want to return to the showback setup process path, click the following link to rejoin it at the next step in the parent topic: Creating SmartTags rules -> Running SmartTags rules.