Starts with

See also: Ends with, Contains

images/download/attachments/201666737/image-2025-4-1_15-30-1-version-1-modificationdate-1743514201440-api-v2.png

The Starts with compare type checks if the text (String) given as the Check value (value configuration on the left) starts exactly with the string (String) defined as the Compare value (value configuration on the right).

  • The screenshot above uses static text value resolvers (see Static values) with the texts 'Check value' and 'Compare value' to illustrate the interaction of the components.

NOTE

  • The text comparison is case sensitive.

  • There is no automatic conversion of unsuitable values to text (String). When required, the Input object (type safe) value resolver or a suitable value resolver from the String processing category can be used to convert another data type into a string.

Special cases:

  • The check is considered failed if at least one of the value configurations (Check value, Compare value) does not return a String.

  • Since 'No value' ($null) is also not a String, a check like ($null) Starts with ($null) is considered failed.

  • If the Check value and the Compare value completely match, a Starts with comparison is considered passed.

  • An empty string ("") can be used as a Check value and as a Compare value. A check with "" as a Compare value will always pass if the Check value is a String.

Specific examples:

Check value
(JSON notation)

Compare value
(JSON notation)

Check result

Comments

"123.45"
"123.45"
images/s/-95e2zf/9012/8yg2g7/_/images/icons/emoticons/check.svg
 true

Check value Starts with the Compare value

"123.45"
"12"
images/s/-95e2zf/9012/8yg2g7/_/images/icons/emoticons/check.svg
 true

Check value Starts with the Compare value

"123.45"
"11"
images/s/-95e2zf/9012/8yg2g7/_/images/icons/emoticons/error.svg
 false

Check value does not start with the Compare value

""
"12"
images/s/-95e2zf/9012/8yg2g7/_/images/icons/emoticons/error.svg
 false

Check value does not start with the Compare value

123.45
"12"
images/s/-95e2zf/9012/8yg2g7/_/images/icons/emoticons/error.svg
 false

Check value is not a String

$null
"12"
images/s/-95e2zf/9012/8yg2g7/_/images/icons/emoticons/error.svg
 false

Check value is not a String

"123.45"
12
images/s/-95e2zf/9012/8yg2g7/_/images/icons/emoticons/error.svg
 false

Compare value is not a String

"123.45"
$null
images/s/-95e2zf/9012/8yg2g7/_/images/icons/emoticons/error.svg
 false

Compare value is not a String

"123.45"
""
images/s/-95e2zf/9012/8yg2g7/_/images/icons/emoticons/check.svg
 true

Check value Starts with the Compare value

$null
$null
images/s/-95e2zf/9012/8yg2g7/_/images/icons/emoticons/error.svg
 false

Check value is not a StringCompare value is not a String

""
""
images/s/-95e2zf/9012/8yg2g7/_/images/icons/emoticons/check.svg
 true

Check value Starts with the Compare value

Configuration

The value configurations for Check value (left) and Compare value (right) are not optional for the Starts with compare type.

Both value configurations must return strings (String) at runtime, otherwise the Entity property rule is considered failed.

Examples

Evaluate a text input

An Entity property rule evaluates a User prompt so that any input that does not begin with the letter 'n' (or 'N') is evaluated as false ('reject') and all others (except "") are evaluated as true ('agree').

NOTE◄ There are, of course, more effective ways to query a purely 'binary' decision from a user, such as the User callback event action. After all, a user might also want to express his 'agreement' by typing 'Of course!'. In this respect, this example is intended to demonstrate the use of the Starts with value resolver rather than best practice in Lobster Data Platform / Orchestration.

Configuration:

Within an Entity property rule, the following value resolvers are concatenated in the Check value (left):

  • The User prompt value resolver provides the input from the user. Details of the configuration are omitted here.

  • The concatenated Default value resolver defines the text 'n' as default in cases where the user does not enter anything.

  • The Trim value resolver removes marginal spaces, which should be considered as unintentional input here.

  • The Lower case value resolver replaces all uppercase letters with lowercase ones, so that the check with Starts with compare type acts indifferently for upper and lower case.

On the right, the lowercase letter 'n' (see Static values) is juxtaposed as a Compare value.

NOTE◄ As can be seen from the label 'not(...)' in the image, the Starts with compare type is negated here (see not (Matcher)), so that the check is considered passed if the User prompt does not start with 'n'.

images/download/attachments/201666737/image-2025-4-1_15-28-59-version-1-modificationdate-1743514139478-api-v2.png

Compare two text files

It is determined whether a text file version.txt was (or at least could be) created by 'extending' another file original.txt in the context of an event handling.

Both files already exist as uploads in a server file system path readable by Lobster Data Platform / Orchestration.

Configuration:

Within an Entity property rule, two instances of the File reference value resolver are used to access the files to be compared (in a subdirectory test of the designated upload folder for Lobster Data Platform / Orchestration).

The File reference value resolver primarily returns a 'Content' object as return value, which represents the plain text of a text file as a byte array (byte[]) in the body field. However, this byte array also forms the basis for the string image of the 'Content' object by default. Therefore, for a text file the concatenated Input object (type safe) value resolver with the String 'type' provides the plaintext relevant for the comparison.

images/download/attachments/201666737/image-2025-4-1_15-27-14-version-1-modificationdate-1743514034615-api-v2.png


NOTE◄ The Entity property rule with the Starts with compare type is also considered to have passed if the contents of the version.txt file are identical to original.txt. In order to reliably ensure – as formulated above – whether the original file was actually 'extended', it must therefore be excluded in the context of an AND conjunction by an additional condition that the file contents are identical (e.g. with not (Matcher) and Equal to).