cancel
Showing results for 
Search instead for 
Did you mean: 

XI mapping : keep empty tags

Former Member
0 Kudos

Hi expers,

I am working on a mapping and I would like to be able to keep the tags of my target structure even if I have no value to map, for instance if I have defined a message type with 3 fields A1, A2, A3, I would like to have this as an output :

<messagetype1>

<A1>value1</A1>

<A2></A2>

<A3>value3</A3>

</messagetype1>

And not this :

<messagetype1>

<A1>value1</A1>

<A3>value3</A3>

</messagetype1>

Has someone an idea ?

Many thanks,

Best regards,

GL

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi Guislain,

Use mapWithDefault node function.

Carlos

Answers (3)

Answers (3)

rahulab
Participant
0 Kudos

Hey Guys,

It did help me too...

Regards

Rahul

Former Member
0 Kudos

Hi,

Just use MapWithDefault function in your mapping and give a default value whatever you want (even empty value).

Exapmple

A1 ---> MapWithDefault -


> Target

A2 ---> MapWithDefault -


> Target

A3 ---> MapWithDefault -


> Target

So when there is value present in A1 & A3 it will take from A1 & A3, but in case of A2 if there is no value present then it will take it from MapWithDefault standard function and you will get the whole structure.

Regards,

Sarvesh

Former Member
0 Kudos

Hi guys,

Thanks that works perfectly !

Thanks again,

GL

Former Member
0 Kudos

Use 'MapWithDefault' option from standard functions.