CompareValuesField plugin
- Last UpdatedApr 24, 2025
- 2 minute read
With this plugin, the system compares the entered value with either another column or a value defined in the argument.
Numeric fields come pre-set with a default value of 0. Since this value is the expected starting point, the CompareValuesField plugin focuses on identifying changes from this default value. This behavior avoids unnecessary alerts or notifications when you have not entered any data.
The following parameters must be set for FieldPlugIn to perform the comparison:
-
Name="CompareValuesField".
-
Args is the argument to compare, and is separated by a comma (,):
-
You can use a value and/or a column.
-
The format is as follows:
<key to use for comparison> space <value or column to compare>, . . . , <key to use for comparison> space <value or column to compare>
-
The valid comparisons are outlined in the table below.
Note: A space is required after the key for the function to work.
|
Symbol |
Key |
|---|---|
|
> |
> |
|
< |
< |
|
>= |
>= |
|
<= |
<= |
Use these symbols and keys to compare numeric values. If there are multiple conditions, separate the conditions with a comma (,). In the following example, the comparison operation is ensuring that the value is greater than, or equal to, 1 and less than, or equal to, 3600.
<Field
Name="badDeltaExpiryTimeout"
.
.
DisplayWidthToUse="Medium">
<FieldPlugIn Name="ValidationRegexField" Args="SimplePositiveFloatNumber" />
<FieldPlugIn Name="CompareValuesField" Args=">= 1, <= 3600" />
</Field>
The entered value can be compared with the values from other columns separated by a comma (,). In the following example, the Minimum (EGU) value must be less than the Maximum (EGU) value.
<Field
Name="totalBlocks#@0#@_@engrunit_@egumin"
.
.
DisplayWidthToUse="Minimum">
<FieldPlugIn Name="ValidationRegexField" Args="GeneralFloatNumber" />
<FieldPlugIn Name="CompareValuesField" Args="< totalBlocks#@0#@_@engrunit_@egumax" />
</Field>
Multiple columns can be used for comparison, with each column separated by a comma (,). In the following example, the Hi Alarm Limit column is being compared with the HiHi Alarm Limit, Lo Alarm Limit, and LoLo Alarm Limit columns to ensure that the entered value is not overlapping other limits.
<Field
Name="hilow_@hilim"
.
.
DisplayWidthToUse="Minimum">
<FieldPlugIn Name="ValidationRegexField" Args = "GeneralFloatNumber" />
<FieldPlugIn Name="CompareValuesField" Args="> hilow_@lololim, > hilow_@lolim, < hilow_@hihilim" />
</Field>
The comparison can be used to compare values and columns at the same time. In the following example, the input rollover value must be both greater than zero and larger than the maximum flow rate.
<Field
Name="inputRollover"
.
.
DisplayWidthToUse="Medium">
<FieldPlugIn Name="ValidationRegexField" Args="SimplePositiveFloatNumber" />
<FieldPlugIn Name="CompareValuesField" Args=">= 1, > maxflowrate" />
</Field>
As seen in the following example, you can use multiple CompareValuesField plugins at the same time.
<Field
Name="hilow_@hihilim"
.
.
<FieldPlugIn Name="ValidationRegexField" Args="GeneralFloatNumber" />
<FieldPlugIn Name="CompareValuesField" Args="<= iengr_@rawmax, > iengr_@rawmin" />
<FieldPlugIn Name="CompareValuesField" Args="> hilow_@hilim, > hilow_@lolim, > hilow_@lololim" />
</Field>
You can insert the conditions in either one line or multiple lines. The CompareValuesField plugin will perform the tasks and produce the correct error message.
<Field
Name="hilow_@hihilim"
.
.
DisplayWidthToUse="Minimum">
<FieldPlugIn Name="ValidationRegexField" Args="GeneralFloatNumber" />
<FieldPlugIn Name="CompareValuesField" Args="<= iengr_@rawmax" />
<FieldPlugIn Name="CompareValuesField" Args="> iengr_@rawmin" />
<FieldPlugIn Name="CompareValuesField" Args="> hilow_@hilim" />
<FieldPlugIn Name="CompareValuesField" Args="> hilow_@lolim" />
<FieldPlugIn Name="CompareValuesField" Args="> hilow_@lololim" />
</Field>