cancel
Showing results for 
Search instead for 
Did you mean: 

mapping help - Empty Value

Former Member
0 Kudos

Hi all,

I have to map an optional Source field to Mendatory Target fiels. If the Source Field is missing / empty, it needes to be filled with a "?". Can any body please suggest how to do this?

I tried using "Exists" mathod of graphical mapping to check for empty(SUPRESS) value, but its didn't worked.

Thanks

-Kulwant

Accepted Solutions (0)

Answers (5)

Answers (5)

Former Member
0 Kudos

Your mapping should be in the following order

1. Check if the source field is missing or empty (for doing this connect the source field to an 'exists' function and the output of this you have to feed to an 'if' function)

2. The 'then' part of the 'if' node should be connected to a 'equalS' function to check if the source field is empty (for this check you have to use another 'if' function) and if it is empty you have to feed the constant '?' to the targt field, and if it is not empty you have to feed the source field itself to the target field.

3. The 'else' part of the first 'if' node should be connected to a 'mapWithDefault' node and double click this node to set '?' as the default value. The output of this 'mapWithDefault' should be fed to the target field.

Edited by: Bharath Sai on Dec 12, 2008 7:01 AM

Former Member
0 Kudos

Hi...

You can do the mapping like

Constant? -


Then

SourceNode -


Equals----- If -


Constant(Empty)-----

SourceNode------Else

Map the above output to the below then condition.

then

Sourcenode -


Exists------- if -


TargetNode

Constant ?------else

Hope this will solve your query.

Regards

Leela

Former Member
0 Kudos

Hi,

http://www.flickr.com/photos/30143464@N05/3101255702/sizes/l/

Here, I am checking if the source field has "" i.e the source field exists but it has "".

the map with default handles in case source field doenst exist at all

check the link. Hope its useful

Venkat

VijayKonam
Active Contributor
0 Kudos

Simply use mapwithdefault functin with ?. You are good to go.

VJ

Former Member
0 Kudos

Hi Kulwant,

You have to use 2 If then Else

First IF then Else layout:

If -> sourceField -> Exist . equalsS -> true

- Then (goto the second IF then Else)

else sourceField -> mapWithDefault (give the default value you want to map)

Second IF then Else layout

check if the sourceField . equalsS Empty. If so, map a default constant. Else pass the sourceField as is.

I tried this out and it works fine.

Regards,

Balaji.M

Former Member
0 Kudos

Can't you give the default value if nothing is coming up from the mapping..