cancel
Showing results for 
Search instead for 
Did you mean: 

Proxy to SFTP CSV File : Empty values handling

Former Member
0 Kudos

Hello,

I have a proxy to SFTP CSV file scenario and i want to apply content conversion using StructXML2Plain module.

My structure is as follow :

<Struct>

     <SubStruct>

          <Col1>Value1</Col1>

          <Col2>Value2</Col2>

          <Col3>Value3</Col3>

     </SubStruct>

     <SubStruct>

          <Col1>Value4</Col1>

          <Col2>Value5</Col2>

          <Col3>Value6</Col3>

     </SubStruct>

</Struct>

When the proxy generates a xml payload without <Col2> in <SubStruct> i'll get this result :

Col1   ;Col2   ;Col3

Value1;Value3

Value4;Value6

I want to get blank value instead of having nothing :

Col1   ;Col2   ;Col3

Value1;          ;Value3

Value4;          ;Value6

How can i do this in StructXML2Plain module ?

Thanks

Sako

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Thank you Ryan and Manoj for your quick response !

So there is no other way to do it in the module except with mapping ?

manoj_khavatkopp
Active Contributor
0 Kudos

I doudt if their is a way to achieve this through standard modules.

Alternatively you can make the target fields mandatory in your data type. then you dont need any change in the mapping

Ryan-Crosby
Active Contributor
0 Kudos

Hi Sako,

If you make the field as mandatory instead of optional then I think the system would insert an empty tag if it has no value from the proxy.

Regards,

Ryan Crosby

Answers (3)

Answers (3)

Former Member
0 Kudos

Thank you my friends you are both right !

I tried to put mendatory field as empty and it comes blank in the csv as i want.

manoj_khavatkopp
Active Contributor
0 Kudos

Sako,

use map with default for col2.

Br,

Manoj

Ryan-Crosby
Active Contributor
0 Kudos

Hi Sako,

In order to include blank values then in the output then you need a mapping that will insert the empty tags - mapWithDefault.  The content conversion will only output values for columns that exist.

Regards,

Ryan Crosby