IsValueInText

The action checks the text referenced by the Target parameter to validate if the text in the Value parameter is a subset of text contained within the Target's text.

Syntax

bool IsValueInText (Target, Value, CaseSensitive)

Parameters

Smart parameters are supported.
Target
A smart parameter that resolves to a target DCO field, DCO variable or string to validate.
Value
Text that the action is looking for in the current field.
CaseSensitive
Determines if the comparison should be case sensitive. Use values True or False. If the parameter is left blank, it defaults to True.

Returns

False if the object's target does not contain the parameter's value. Otherwise, True.

Level

All but typically field level.

Details

The action checks the text referenced by the Target parameter to validate if the text in the Value parameter is a subset of text contained within the Target's text. The Value can exactly match the length the input text or can be a portion of the input text. If the case sensitive parameter is true then the substring must exactly match the case of the comparison text.

If the comparison requirement is met, the action returns true. If the comparison requirement is not met, the action returns false and also sets a corresponding error message in the standard Message variable that is used by clients to display in verification panels when a rule check fails. The message is set on the DCO that is calling this action, so it is typically useful to call this action on the DCO object that is being checked so the message is associated with the same object.

Example 1

IsValueInText("@F", "NEW", "")

Assuming this action is called on a ruleset attached to a field object, it compares the text value of the current field with the word "NEW" to confirm if the word NEW is contained in the source field. The following are return values based on the field's text value:

Field contains: "NEW" = TRUE

Field contains: "I Love NEW YORK" = TRUE

Field contains: "Project" = FALSE

Field contains: "NEW Project" = TRUE

Field contains: "New Project" = FALSE

Field contains: "Development" = FALSE

IsValueInText("@F", "@P.MyVariable", "False")

This example compares the text value of the current DCO field with the value of the variable MyVariable which is on the parent page object. The comparison is case insensitive.