Absent Member.
Absent Member.
1149 views

Conditional Map on Blank Field

Hi,

Does anyone know how to create a map file which will populate a field only if the field arrives blank at the connector? For instance

event.flexString1,set.event.flexString1

"",myValue

I'm assuming "" doesn't work. Can null be used or is there a way to use regex to match null?

Thanks

Labels (2)
0 Likes
2 Replies

Not sure if it can be done in a map file but you should be able to do it in a parser override. You can use the __ifThenElse token operation.

(Where message is the token)

event.flexString2=__ifThenElse(message, null, myValue, message)

So basically message is compared to null, if it is null then myValue is returned, else (its not null) the original message is returned.

Hopefully this helps.

-Andrew

0 Likes
Absent Member.
Absent Member.

As an update to this, where Connector software > 7.0.4, you can do this with a map file using syntax like the following:

set.event.flexString1

"__oneOf(flexString1,myValue)"

Basically, __oneOf will iterate through the values provided, returning the first string that is not null, or returning null if all strings are null. The quotes are required since the setter field has a comma.

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.