Notes on expressions in dynamic fields

Before you write expressions for the Dynamic fields in a catalog item, it is important that you note the following limitations and behaviors.

Supported Operators

The Condition and Query rules follow the HPE Service Manager standard, except that only the following operators are supported:

  • & (the AND operator)
  • | (the OR operator)
  • ~= (NOT EQUAL TO operator)

Mandatory Conditions

You can only specify a Mandatory condition for the Text, Multi-Text, and Pick List Display Type. The Mandatory condition can be specified as any of the following four types:

  • Hard coded: true, false

  • Variable condition: name in $lo.operator=”falcon”

    Only global variables are supported. The global variable list is generated only when a user logs in to Service Request Catalog.
  • Dependent on other widget in the user selection: [widget_name] =”falcon”

    In this example, widget_name is name of another widget in the user selection. If the dependent widget does not exist, an error message appears.

  • Dependent on the fields of a catalog item outside of the user selection: $requested.for=”FALCON, JENNIFER”

    Only the $requested.for, $requested.for.dept, $delivery,and $service.sla variables are supported.

Visible Conditions

You can specify a Visible condition for all Display Types.

Mandatory and Query Condition Sample
Type: Possible values: Notes:

Hard code condition:

true
false

 

Variable condition:

company in $lo.operator="advantage"

The company on the right is an element of the object. Only Global variables are supported

Dependent on other widget:
[widget name]="specificValue"
[widget name] is a placeholder for the name of another widget in the user selection.
Dependent on the fields of catalog item outside of the user selection:
$requested.for="FALCON, JENNIFER" 

Only the following values are supported in Service Request Catalog:

$requested.for
$Requested.type
$requested.for.dept
$delivery
$service.sla

Query fields

The Query field only appears when you have specified the following attributes for your dynamic user option field:

  • Display Type: Text
  • Type: String
  • Validation Rule: Record in Table

If your Dynamic field meets these criteria, you must then specify the following:

  • Table Name: some_table
  • Field Name: some_field
  • Query Condition:
  • Group by Fields: This field is not supported by Service Request Catalog.

Note If you click the Edit button, the advanced query window appears.

Query sample
Type: Possible values: Notes:

Hard code condition:

true
false
contact.name="FALCON, JENNIFER" 

 

contact.name is a column of the selected table.

Variable condition:

display.currency.code=$G.my.currency
company = company in $lo.operator

 

The company on the left is a column of the selected table. The company on the right is an element of the object.

Dependent on other widget:
name =[widget name] 
[widget name] is a placeholder for the name of another widget in the user selection. name is a column of the selected table.
Dependent on the fields of catalog item outside of the user selection:
contact.name=$requested.for 

contact.name is a column of the selected table. Only the following values are supported in Service Request Catalog:

$requested.for
$Requested.type
$requested.for.dept
$delivery
$service.sla

 

Other Behaviors

For any set custom Dynamic user option fields, you can very easily create a complicated set of rules. Therefore, it is important that you recognize the following behaviors:

  • By default, the Mandatory condition is false. If the condition format is not correct, or any JavaScript function call does not exist, then the user option is not mandatory.
  • By default, the Visible condition is true. If the condition format is not correct, or any JavaScript function call does not exist, then the user option is visible.
  • If a Mandatory condition for a user option is true, but the visible condition is false, a request for that item can still be submitted successfully.
  • If the condition format is not correct, or any JavaScript function call does not exist, an empty list is returned.
  • If a user option has dependencies on two other user selected fields and the first field has no value, whether second field returns all or empty is decided by the condition expression of the second field. String, number, check box, and date may all behave differently.
  • A field that is dependent on another field is cleared automatically if the second field is cleared.
  • The Mandatory designation only exists in the Service Request Catalog user interface. In Service Manager, an error message will display when a user does not set a value for mandatory field.
  • The Visible behavior only exists in the Service Request Catalog user interface.
  • In the case of a circular query condition (where A depends on B, and B depends on A), an empty set is returned.
  • In the case of a circular Mandatory condition (where A depends on B, and B depends on A), an empty set is returned.
  • In the case of a circular Visible condition (where A depends on B, and B depends on A), an empty set is returned.
  • You cannot delete a user selection from Service Manager if another field or user selection depends on it.
  • The Query Condition does not support the currency exchange rate.  This is due to a limitation in Service Manager, which supports dollar values as numbers, instead of currency. To work around this issue, you can display the currency as a number together with a list that specifies the actual currency (for example, USD or RMB), and the approving manager's name based on your business requirements (if the request is over 500 USD, for example).