cancel
Showing results for 
Search instead for 
Did you mean: 

Sender file adapter with FCC not creating last field

Marçal_Oliveras
Active Contributor
0 Kudos

Hi,

I've got the following file:

field1;field2;field3

FCC is the following:

Recordset streucture: ITEM,*

ITEM.fieldSeparator ;

ITEM.endSeparator 'nl'

ITEM.fieldNames FIELD1,FIELD2,FIELD3

ignoreRecordsetName true

I expect to generate the following XML:

<FIELD1>field1</FIELD1>

<FIELD2>field2</FIELD2>

<FIELD3>field3</FIELD3>

That's working OK. The problem is when I receive a file with the FIELD3 empty. Example:

field1;;

I expect:

<FIELD1>field1</FIELD1>

</FIELD2>

</FIELD3>

But I get:

<FIELD1>field1</FIELD1>

</FIELD2>

And this raises an error during the mapping because the FIELD3 is mandatory in the Data Type definition, even it's empty

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi Marshal

You can use mapWithDefault in the message mapping to create target element even if source is missing.

Otherwise, you can try using parameter ITEM.missingLastfields = add in your content conversion.

Regards,

Giuseppe

Marçal_Oliveras
Active Contributor
0 Kudos

Thank you Giuseppe,

ITEM.missingLastFields = add has worked. I thought I has tried it this morning, but I guess I missed something

Answers (2)

Answers (2)

Shabarish_Nair
Active Contributor
0 Kudos
I expect:
<FIELD1>field1</FIELD1>
</FIELD2>
</FIELD3>

But I get:

<FIELD1>field1</FIELD1>
</FIELD2>

use a mapwithdefault in your mapping so that it will always create an empty node if there was no value to be mapped to the target field.

Former Member
0 Kudos

Hi

remove ITEM.endSeparator 'nl'

Regards,

Carme