Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Table of Contents
maxLevel1
typeflat

Einleitung

String Expressions können verwendet werden um die Werte von Attributen visuell zu berechnen. Dabei wird zwischen Kontext- und Funktions-Expressions unterschieden. Kontext-Expression können als Eingabe-Bausteine verstanden werden. Mit den Funktions-Expressions kann die Logik gesteuert und die Kontext-Expressions mutiert werden.

Kontext-Expressions

Folgende Kontext-Expressions stehen zur Verfügung:

...

Relation
Welches Asset Attribut des Objektes

Attribut
Welches Attribut des ausgewählten Asset Attributes

...

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:

...

Minimum
Die kleinst mögliche Zahl

Maximum
Die grösst mögliche Zahl

...

Anzahl
Wieviele Zeichen

Zeichengruppe
Eine Liste der möglichen Zeichen

...

Funktions-Expressions

Folgende Kontext-Expressions stehen zur Verfügung:

...

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

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

Vergleichswert

...

Input → "Das ist ein Test"

...

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"

...

Füllzeichen
Das Füllzeichen

Total Länge
Bis zu wievielen Zeichen aufgefüllt werden soll

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"

...

Füllzeichen
Das Füllzeichen

Total Länge
Bis zu wievielen Zeichen aufgefüllt werden soll

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"

...

Länge
Die gewünschte Passwort Länge

...

Result → "Hello-----"

...

Password

Generates a password

Length
The desired password length

Drawing group(1-6)

...

Seed
Die String Expression generiert für den selben Seed, das selbe Passwort. So kann beispielsweise anhand einer Kombination von AHV-Nummer und Prüfungsnummer das selbe Passwort generiert werden.

Länge → 8

...

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"

Resultat → "Das ist ein Haus"

...

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

Alter Wert
Der zu ersetzende Wert

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 → "

...

Beispiel

Folgendes Beispiel zeigt wie man aus Vor- und Nachnamen einen Benutzernamen generiert welcher folgender Regel folgt:

  • Erstes Zeichen Vorname
  • Mindestens vier Zeichen des Doppelnamen befreiten Nachnamens
  • Maximal 14 Zeichen in Kleinbuchstaben
  • Wenn der Benutzername bereits vergeben ist, soll eine Nummerierung erfolgen

Image Removed

How-to Artikel

Filter by label (Content by label)
showLabelsfalse
showSpacefalse
cqllabel in ( "how-to" , "string" , "expressions" ) and type = "page" and space = "IKB"

Verwandte Artikel

Filter by label (Content by label)
showLabelsfalse
showSpacefalse
cqllabel in ( "string" , "expressions" , "attribute" ) and type = "page" and space = "IKB"

This is"

...

Input → "Das ist ein Test"

Resultat → "DAS IST EIN TEST"

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

...