Setting Data Policies

Adding Rules to Forms

Rules prevent users from entering bad data. You can add as many rules you would like to single form and multiple rules for each field on the form.

For example, you could add two rules to the Location field.

  1. Add a Not Empty rule to ensure the user enters a value for the field.
  2. Add a Depth rule to ensure the user picks a location down to the third level.

When you add rules, you can indicate the level of the rule (Error, Warning or Message) as well as where the rule should be run: on the form itself, in the Queue or when records are published.

Table of rules

RuleFieldsDescription
Not EmptyAllRequires the field to have data.
Detect new valueObject (Assignee, Model, Location)Detects if the data collector created a new record in a reference field.
String PatternTextEnsures the value provided in a field matches a regular expression you provide. This is our most powerful validator, as it can ensure data meets very specific formats.
String Pattern with controlling fieldAllEnsures the value provided in a field matches a regular expression you provide, along with a controlling field of your choosing.
String LengthTextAllows you to specify a minimum and maximum length, and trims trialing spaces.q
Required for asset statusAllRequires the field if asset status is valid.
Required for new assetAllRequires the field if it is a new asset.
Unique in databaseTextInput value must be unique to prevent duplicates
Value has changedAll

Detects that the value has changed.

At least one key field is requiredNoneMust input one of the 5 key fields (Asset Tag, Serial, MAC address, Custom Key 1, Custom Key 2)
New AssetNoneDetects if this is a new asset. It can also be used to flag new assets.
Older data existsNoneDetects if older data exists in the database.

 

Some of these rules will also have different properties that can be set to them. Once you have added a rule to the form, you can select that rule in the rule list and at the bottom of the management console you will find the Rule properties box. For rules like, String pattern with controlling field, there are more rule settings if you scroll to the bottom of the Rule properties box seen below.

 

   

 

To add a rule to a form:

  1. Select the Data Policy tab in the form designer.



  2. The Data Policy tab displays a list of all rules and scrubbers currently attached to this form. To add a new rule, click the Add button. The new rule dialog appears.



  3. Select the field on which you want to apply the rule from the Field drop down list.



  4. Next, choose the rule you wish to add from the Rule to add drop down list.



  5. Click the OK button to add the rule to the form. The rule is now listed in the Apply these rules to this form list.



  6. Click on the added rule to set its properties. The rule properties panel displays the properties for the selected rule.

See Understanding Rule Violation Messages in the Queue for a detailed explanation of rules in AssetTrack.

Adding Scrubbers to Forms

Scrubbers automatically correct input that is entered into fields. Scrubbers can only run in the queue and during publishing. You can add as many scrubbers as you would like to single form and multiple scrubbers for each field on the form. Scrubbers will be applied in the order that they are listed in the scrubbers list.

RuleFieldDescription
Case ChangerAllConverts all values to either uppercase or lowercase.
Find and replaceAll

Finds and replaces all values.

Removes all trailing spacesAllRemoves all Trailing spaces
Assignee code find and replaceAssingeeFinds and replaces all assingee code values.

 

To add a scrubber to a form:

  1. Select the Data Policy tab in the form designer.



  2. The Data Policy tab displays a list of all rules and scrubbers currently attached to this form. To add a new rule, click the Add button. The new rule dialog appears.



  3. Select the field on which you want to apply the rule from the Field drop down list.



  4. Next, choose the rule you wish to add from the Rule to add drop down list.



  5. Click the OK button to add the rule to the form. The rule is now listed in the Apply these rules to this form list.



  6. Click on the added rule to set its properties. The rule properties panel displays the properties for the selected rule.

Note Note

A scrubber that runs in both the queue and at publish time will be executed when the data enters the queue and when the data is published, so if a scrubber is added that finds "a" and replaces it with "aa", a collected value of "a" will enter the queue as "aa" and then be published to handlers as "aaaa". If set to autopublish, the same "a" will be published as "aa", since autopublishing bypasses the queue.

Note Note

The find and replace scrubber supports regular expressions. For more information about regular expressions and how to use them, see this page from Microsoft.