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.
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.
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.
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.
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.
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.
To view more options, click Advanced View. The Advanced View dialog box displays:
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:
|
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:
|
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.
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:
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.
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:
To do this, from the function menu:
- Select min(1,2,3,...).
- In the Function dialog box, click Field and then select Rate.
- 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.