Absent Member.
Absent Member.
1254 views

Token Operations Question.

Jump to solution

Hi.

I need to change token value by ifelse operator. What syntax?

For example:

From event I have token value=A, but I need to change this value for event field to value=B? I understanding that i need token operators, but not understanding right syntax. Please, help me.

Labels (2)
Tags (2)
0 Likes
1 Solution

Accepted Solutions
Absent Member.
Absent Member.

Use the __simpleMap function. There are samples in the flex connector guide.

View solution in original post

0 Likes
7 Replies
Fleet Admiral
Fleet Admiral

Hi Mikhail,

I need more information to know exactly which operator to use but there are the available operators using to make an if then else condition, the second column is the result type.

__ifThenElse String

__ifThenElseAddress IPAddress

__ifTrueThenElse String


Or


__regexToken used with __oneOf may be used to do the same required condition (cf. pdf)


I advice you to check in this document (last version) presents on Protect724 where you will find the token operation list with clear explanation and some example following the connector type you need to set-up.

I hope this information will help you.

Thanks

Best regards

Michael

0 Likes
Absent Member.
Absent Member.

The syntax looks something like this:

event.fieldxxx=__ifThenElse(lookup token,comparison value,if true return this,else return this)

For Example:

event.sourceUserId=__ifThenElse(test_userid,"","Not Available",test_userid)

Basically that checks the token test_userid, and if its blank returns "Not Available" else it returns the value.

0 Likes
Absent Member.
Absent Member.

Thks.

It really helps me, Can you tell me what syntax for situation when I had 3 or more values for if.

For example

If a=b then

     do 1

elseif

a=c

then

do 2

elseif

d=e

then

do 3

0 Likes
Absent Member.
Absent Member.

Have a look at __simpleMap ... that may help you.

0 Likes
Fleet Admiral
Fleet Admiral

Hi Mikhail,

You may interconnect TokenOperators as __ifThenElse(__ifThenElse( , , ), ,) or

you may also use this one __ifAorBThenElse( , , , , )

I really advice you to check in this document maybe other operator will be better to choose following your use case.

Thanks

Regards

Michael

0 Likes
Absent Member.
Absent Member.

Hi.

My case:

I have one token and 4 token values, there is:  0, 1, 2, 3.

I need to change 0 to "string1", 1 to "string2", 2 to "string3". How I can do this with __ifThenElse operator? Not understand

0 Likes
Absent Member.
Absent Member.

Use the __simpleMap function. There are samples in the flex connector guide.

View solution in original post

0 Likes
The opinions expressed above are the personal opinions of the authors, not of Micro Focus. By using this site, you accept the Terms of Use and Rules of Participation. Certain versions of content ("Material") accessible here may contain branding from Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE marks are the property of their respective owners.