User Fields

User Fields are used to assign custom values to users. This article provides an introduction to the principle of user fields and guides you through creating them.

📘

To administer User Fields, please ensure the user has been given the applicable Access Rights under Users > User Fields

Search User Fields

User fields can be managed in Aurora by navigating to Users > User Fields.

A paginated list of all the user fields will be displayed.

The listing page provides the ability to filter User Fields. Using the search box displayed at the top of the listing page you can enter a search term to match on the fields “Name” and "Clean Field Name" value. A filtered list of results matching your search criteria will then be displayed.

The screenshot below shows all User Fields with names containing the value com.

The user fields listing page can also be customised to aid searches, by clicking on the cog icon, the number of results and alphabetical sorting options are displayed.

Creating User Fields

A new user field can be created by clicking on the green Add New Field button on the top right of the listing page. The Add User Field page will be displayed with an empty form.

The following table lists the description for each field.

FieldDescriptionFormat
Field NameThe name of the user fieldA-Za-z0-9 (space)'-_
Clean Field NameA normalised version of the field name.
This is used to represent the field in template data.
If not provided, this value will be derived from the Field Name
A-Za-z0-9_
Field TypeThe form field type for the field.Text or Text Area

🚧

New User Field Restrictions

Field Name and Clean Field Name must be unique - the system will prevent fields being created if there is an existing field with the same Field Name or Clean Field Name.

🚧

Please ensure your field has the correct properties before saving because:

  • User fields cannot be removed
  • The Clean Field Name cannot be modified

Editing User Fields

You can modify existing User Fields from the listing page by either clicking on the name of the desired field or the pencil icon. This will display the Edit User Field page.

The page will display a populated form. Once the required changes have been made, clicking Edit Field will save the changes.

🚧

Edit Order Fields Restrictions

Take care when editing a Field Name to ensure it’s new name continues to contain the original context. If the name is changed to something unrelated you might lose understanding of what values have already been captured on existing users. For example, renaming a User Field from “Company Number” to Client Number.

In these cases it would be more appropriate to create a new user field.

Edit a User's Field Data

User Field data for a user can be edited by locating the relevant user from Users > Customers or Users > Admin Users and selecting the Fields tab.

A list of the User Fields will be displayed

Each User Field is displayed with any values that are set.

Clicking the Add icon will add an empty field within which a new value can be added.

The delete action will remove the associated value.

Once the required changes have been made, clicking Update Fields will save the changes.

Members area template field data

User fields data is made available to the members area summary template in the $user_additional_fields Smarty variable.

This variable is an array, keyed by the field Clean Field Name.

array (
  'user_aurora_version_number' => 
  array (
    'clean_field_name' => 'user_aurora_version_number',
    'field_name' => 'user_aurora_version_number',
    'field_type' => 'text',
    'field_value' => 
    array (
      0 => '19478',
    ),
    'is_system_field' => false,
  ),
  'company_number' => 
  array (
    'clean_field_name' => 'company_number',
    'field_name' => 'Company Number',
    'field_type' => 'text',
    'field_value' => 
    array (
      0 => '123456789',
    ),
    'is_system_field' => false,
  ),
  'orders_list_load_order_on_barcode' => 
  array (
    'clean_field_name' => 'orders_list_load_order_on_barcode',
    'field_name' => 'orders_list_load_order_on_barcode',
    'field_type' => 'text',
    'field_value' => 
    array (
      0 => 'print_invoice',
    ),
    'is_system_field' => false,
  ),
)
Field NameTypeDescription
clean_field_nameStringClean Field Name of the field
field_nameStringName of the field
field_typeStringField Type: text or textarea
field_valueString ArrayAn array of values for the field

Example Smarty code that will iterate over each field and output all saved values:

    {foreach $user_additional_fields as $field}
        <h3>{$field.field_name}</h3>
        <p>
            {foreach $field.field_value as $field_value}
                {if $field.field_type === 'textarea'}
                    {$field_value|nl2br}<br>
                {else}
                    {$field_value}<br>
                {/if}
            {/foreach}
        </p>
    {/foreach}

📘

For backwards compatibility, fields that predate the User Fields management User Interface will still be available in the original format in the Members area templates.

However, this format is now deprecated.

Template developers are encouraged to move away from this format for these fields as soon as possible.