
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
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

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
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

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
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.