String Expressions

Introduction

String expressions can be used to visually calculate the values of attributes. A distinction is made between context and function expressions. Context expressions can be understood as input modules. Function expressions can be used to control the logic and mutate the context expressions.Kontext-Expressions

The following context expressions are available:

Name

Description

Parameter

Example

Name

Description

Parameter

Example

Asset context

If an asset is assigned to the object, the attributes of the asset can be selected here

Relation
Which asset attribute of the object

Attribut
Which attribute of the selected asset attribute

The primary phone number

Context

All attributes of the current object



The first name of the person

FixText

A fixed text



"ITSENSE AG"

Iteration

The current iteration of the calculation. If the value cannot be determined unambiguously, the iteration is increased.





Random number

A random number

Minimum
The smallest possible number

Maximum
The largest possible number



Random characters

Random characters from a group of characters

Quantity
How many characters

Drawing group
A list of possible characters



Random bytes

Random bytes

Anzahl
How many Bytes




Functions-Expressions

The following context expressions are available:

Name

Description

Parameter

Example

Name

Description

Parameter

Example

NullIfEmpty

If the input is null or an empty string, it will return null. If there is any input, it will return the input.



If firstnameis null or empty, return null. Else return firstname.

Date formatting

Formats the input in the specified format

Formatting
The format of the formatting.

d MMM yyyy

Culture name resolver

Resolves an LCID to a culture name

Standard-Kulturname
If the LCID cannot be resolved, which Culture should be used



Only valid characters

Removes all invalid characters

Replace Diacritics
Whether or not diacritics should be replaced.

A-Z
Allow capital letters

a-z
Allow lowercase letters

0-9
Allow numbers

Zusätzliche Zeichen
Additional characters which should be allowed



Concat

Joins several elements together

Prefix
Will be added in front

Suffix
Will be added at the end

Prefix → "_"

Input → "Hello"

Suffix → "_"

Result → "_Hello_"

Remove double name

Removes double names

Name-Min-Length
How long a name must be at least

Müller-Meier → Müller

Bo Tao → Bo Tao (For minimum length 4)

Template→ Template

If-Then-Else

classic If / Then / Else

If
Condition

Comparative value



Lower case letters

Converts the input to lowercase letters



Input → "This is a house"

Result → "This is a test"

MD5 Hash

Calculates the MD5 hash value of the input



Input → "This is a test"

Result → "B112C76D02B5832E8D83B74C102E0CA5"

Fill left

Fills the input on the left side with the specified character up to the specified length

Fill character
The fill character

Total length
Up to how many characters should be padded

Fill character→ "-"

Total length→ 10

Input → "Hello"

Result → "-----Hello"

Fill right

Fills the input on the right side with the specified character up to the specified length.

Fill character
The fill character

Total length
Up to how many characters should be padded

Fill character→ "-"

Total length→ 10

Input → "Hello"

Result → "Hello-----"

Password

Generates a password

Length
The desired password length

Drawing group(1-6)
Different groups of characters to be used

Seed
The string expression generates the same password for the same seed. For example, a combination of AHV number and exam number can generate the same password.

Length→ 8

Drawing group 1 → "ABCD"

Drawing group 2 → "1234"

Result → "AC4D22AB"

RegexReplace

Replaces the specified pattern with the specified replacements in the input

Pattern
Regex Pattern

Replacements
With what the pattern should be replaced

Pattern → "T.*t" 

Replacements → "House"

Input → "This is a test"

Result → "This is a house"

Remove umlauts

Removes all umlauts from a text and replaces them with the corresponding equivalent.





"Ä" --> "Ae"
"ä" --> "ae"
"Ö" --> "Oe"
"ö" --> "oe"
"Ü" --> "Ue"
"ü" --> "ue"
"Æ" --> "AE"
"ß" --> "ss"
"æ" --> "ae"

Replace

Simple Find / Replace

Old value
The value to be replaced

New value
The new value

Alter Wert → "Test"

New value → "House"

Input → "This is a test"

Result → "This is a house"

Substring

Cuts the input to the desired length

StartIndex
Where to start in the input

Max. length
How many characters to take

StartIndex → 0

Max. length→ 7

Input → "This is a test"

Result → "This is"

Capital letters

Converts the input to uppercase letters



Input → "This is a test"

Result → "THIS IS A TEST"

Code

Executes a .net code block

Expression
Code block

Input
Inputfield, can be mapped with context expressions

Expression: → System.Text.RegularExpressions.Regex.IsMatch(input, ".*@coreone.ch").ToString()

Input: → [Core Identity: Email]

Example

The following example shows how to generate a user name from first and last name which follows the following rule:Erstes Zeichen Vorname

  • At least four characters of the double name exempt surname

  • Maximum 14 characters in lower case

  • If the user name is already assigned, a numbering is to take place

© ITSENSE AG. Alle Rechte vorbehalten. ITSENSE und CoreOne sind eingetragene Marken der ITSENSE AG.