cancel
Showing results for 
Search instead for 
Did you mean: 

How to set Default value as " " for Date/Time fields using Mapwithdefault function.

smit1209
Explorer
0 Kudos

In our target mapping XSD, we have a datetime field with minoccurs=1

<s:element minOccurs="1" maxOccurs="1" name="UPDATED_ON" nillable="true" type="s:dateTime"/>

When doing a message mapping to this field, if there is no data, the generated XML does not contain a tag for UPDATED_ON. This gives an error on the target side.

We need an empty tag when there is no data for this field. For example <UPDATED_ON><UPDATED_ON/> or </UPDATED_ON>

Please let me know if there is a way to achieve this.

I do not want to use MapWithDefault and pass a dummy datetime value to generate the tag as this would be passing incorrect data.

Accepted Solutions (0)

Answers (2)

Answers (2)

former_member190293
Active Contributor
0 Kudos

Hi Smit!

Your target XSD scheme requires element to be created. So, there is no other way, I guess, besides assigning value to that element in message mapping. You could use "Constant" function to assign empty value to your element, for example.

And "MapWithDefault" is to be used when source queue doesn't contain any value in given context.

Regards, Evgeniy.

0 Kudos

you can use Mapwithdefault. But you need not set any default value.

In that case you will send <UPDATED_ON/>.