Axonius - Add Custom Data to Assets
  • 02 Jan 2025
  • 7 Minutes to read
  • Dark
    Light
  • PDF

Axonius - Add Custom Data to Assets

  • Dark
    Light
  • PDF

Article summary

Axonius - Add Custom Data to Assets does either of the following for assets returned by the selected query or assets selected on the relevant asset page:

  • Add a Custom Field (name and value) to the assets.
  • Add or replace a value of a Custom Field or Axonius Field that already exists on the assets.

Once added, you can use the Custom Field in future queries.

Learn more about Custom Data.

See Creating Enforcement Sets to learn more about adding Enforcement Actions to Enforcement Sets.

Note:

Required Fields

These fields are required to run the Enforcement Set.

  • Action name - The name of this Enforcement Action. The system sets a default name. You can change the name.
  • Configure Dynamic Values - Toggle on to enter a Dynamic Value statement. See Creating Enforcement Action Dynamic Value Statements to learn more about Dynamic Value statement syntax.

Note:

When this action pulls an Axonius Integer field and performs calculations on it, it sends the result to the new Custom String Field as a Float value and does not convert it back to an Integer value. For example, it adds 3 to an Axonius Integer field (435) and sends 438.0 to a Custom String Field instead of converting it to 438 (an Integer). To bypass this conversion, it is recommended to create a Dynamic Value Statement where you apply the to_int function on the Integer field. This ensures that a number in Integer format is sent to the Custom String Field.

  • Field name - Here you can either create a new Custom Field, or select a Predefined Custom Field or Axonius Field. If the Predefined Field already exists on the asset, you can replace its value or add to its values.

The following sections describe how to fill in the required fields for the abovementioned options.

Creating a New Custom Field

To create a new Custom Field to add to the asset

  1. Type a new field name and then click + New Field Name.
Note:

Custom field names support special characters (i.e., not alphabetic or numeric characters). However, the system does not support giving a custom field a name identical to that of an already existing custom field apart from special characters. For example: If CustomField*1 is a defined custom field, you cannot name a new custom field CustomField$1 or CustomField#1.

  1. From the Field type dropdown, select one of the following:
    • Single Value - Creates a single-value field.
    • Multiple Values - Creates a list field.
  2. From the Value type dropdown, select a value type according to the field type that you selected in the previous step. The value types are:
    • String
    • Date - Learn about Adding Dates
    • Float
    • Integer
    • Boolean - Available only for Single Value fields.
  3. Type a value into the Field value box.
    • When the Field type is Single Value, type a value.
      • For a String, Float, or Integer value type, in the Field value box, type a free-text value for the custom field.
      • For a Boolean value type, from the Field value (True/False) dropdown, select either Yes or No.
      • For a Date value type, select the current date or a specific date. Learn more about Adding Dates.
    • When the Field type is Multiple Values, in the Field Value box, type a list of field values.
      • For a String, Float, or Integer value type, in the Field value (list [field type]) box, type a value, and then press Enter, comma, or semicolon to add it to the list. You can also paste a comma separated list into the field. To learn more, see Adding a List String below.
      • For a Date value type, in the Field Value (list date) box, select the current date or specific dates. Learn more about Adding Dates.
      • The Append values if field exists (list [field type]) checkbox becomes available. When enabled, if the Multiple Value field already exists on the asset, the field values entered in this Enforcement Action are added to the existing values on the asset field. Otherwise, the entered field values overwrite the existing field values.

Adding a Predefined Field

To select a Predefined Custom Field or Axonius Field

  1. From the Field name dropdown, filter the list of fields, to select a Custom Field or an Axonius Field that is already defined in the system. Either add this field to each asset, or, if it already exists on the asset, add values to it or replace its values.
  2. The Field type and Value type are automatically filled in according to the custom field configuration.
  3. To add or replace values from this field, follow step 4 as explained in Creating a New Custom Field.

Adding Dates

You can add a Date custom field to assets. This can be useful to identify the first time an asset was noncompliant.

  • For a Single Value date field you can add a single date - the Enforcement Action run time or a different date.
  • For a Multiple Values date field you can add the Enforcement Action run time (a single date) or a list of other dates.

Adding a Single Value Date Field

  1. From the Date type dropdown, select Now (Execution time) or set a Specific date. The times displayed are in UTC.
    • Now (Execution time) sets the date to the Enforcement Action run time.
    • Specific date can be either in the past or future. This option also contains an exact hour to select. In the Set date box, select a date from the calendar and an hour from the time picker (the default is 00:00), and then click Ok.

TimeDatePicker

  1. The Do not overwrite If field exists (True/False) checkbox becomes available. When enabled, if the Date field already exists on the asset, the date value entered in this Enforcement Action does not replace the existing date on this field. This can be useful, for instance, if the action added a custom date to show the first time something was found on the system, and you do not want to overwrite this value. Otherwise, if you do not enable this option, the entered date replaces the existing date.

Adding a Multiple Values Date Field

  1. From the Date type dropdown, select Now (Execution time) or set Specific dates. The times displayed are in UTC.
    • Now (Execution time) sets the date to the Enforcement Action run time.
    • Specific dates can be either in the past or future. This option also contains exact hours to select. In the Field value (list date) box, click Add Date to select a date and an hour for each list item and then click Ok. Repeat for each date that you want to add.

TimeDatePickerMulti

  1. The Append values if field exists (list date) checkbox becomes available. See explanation at the end of the Creating a New Custom Field section.
Note:

When you create a Dynamic Value Statement for adding a custom date field, ensure to use form.field_date.specific with Date type set to Specific date, as a dynamic date can be written only to this type of Date field. Do not use form.field_date.now or a field with Date type set to Now, as this type of field cannot accept dynamic input and regardless of the statement, its value is always the action runtime.

Adding a List String

To add items to a list string

  • Do one of the following
    • Type the name of the field value and press Enter.
    • Type the name of the field value and press Comma (,).
    • Type the name of the field value and press Semicolon (;).

For example:

  • Type 'Paris' and press Enter. A tile named 'Paris' is added to the list.
  • Type 'London' and type a comma ','. A tile named 'London' is added to the list.
  • Type 'Montreal' and type a semicolon ';'. A tile named 'Montreal' is added to the list.

AddingAList

To remove items from the list, click the x in the tile you want to remove.

Additional Fields

These fields are optional.

  • Remove this custom data field from entities not found in the query results (True/False) - Toggle on this option to remove the Custom Field from all entities that are not part of the list of assets on which the Enforcement Action ran. Be aware that selecting this option can cause the removal of Custom Fields added by other users or Enforcement sets.

    • To see a list of the assets, which are not in the query results, view the run history detail and click Additional in the drawer header.
      ECRunHistory-AdditionalCustomData.png

    • When this option is toggled on, the following sub-options appear:

      • Remove entire field - Select this option to remove the entire field from entities not in the query results.
      • Remove values field - Relevant for Multiple Values fields. Select this option to remove from entities not in the query results, only the field values added to the Multiple Values field (for assets in the query) using this Enforcement Action (these are the field values in Field value (list string) under Required Fields).

For more details about other Enforcement Actions available, see Action Library.


Was this article helpful?