Absent Member.
Absent Member.

Conditional Map on Blank Field


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



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


Labels (2)
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.


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:



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.

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.