Integrating Integrators – BizTalk, Windows Azure, Windows Workflow, and Beyond

Re: Flat File - Null values

BizTalk 2006

This group is for all content related to BizTalk Server 2006. This includes a forum, samples, videos, labs, and tools. Most of the content here also applies to other versions of BizTalk beyond 2006.

Flat File - Null values

  • rated by 0 users
  • This post has 5 Replies |
  • 0 Followers
  • Does anyone have suggestions for how to deal with null values in an inbound flat file message?  I would like to have null fields set to an empty string or some other value versus being allowed to go through as null.

     Thank you for the input,

    Mark

  • Hey Mark,

    I have had to do this myself. Set the "Default" value of the element in the Destination Schema to some value. My destination schema is a SQL updategram and I like to have NULLs from the input mapped to spaces; enough to fill the column.

     


    Greg Smith

    BizTalk Admin

  • Greg:

    That is exactly what I'm needing to do as well.... that is map to an updategram schema.  Before posting here, I did attempt to set the Default attribute, but without any luck.  I simply hit the space bar for that value... and the XSD showed an emptry string as I would have exptected. Yet, when validating against a known "bad" file, I still received the nasty error about null values (0x00). 

    I'm wondering if I need to set the pad charcter or something else in the schema...

    Mark

     

  • Oh my gosh!  Why can't a BizTalk developer easily find this kind of information?!

    It turns out that in fact if you set the "Pad Character" to "0x00" with the "Pad Character Type" set to "Hex" that indeed you can strip out the null values.  Additionally, I have the "Default" value set to a space.

    From the BTS2006 R2 docs:

    You can use the Pad Character property to ensure that pad characters in a field are removed from a document instance submitted to BizTalk Server. The Minimum Length with Pad Character property value ensures that BizTalk Server inserts pad characters into a field in the output document instance, if this is desired. The Justification property indicates on which side of the field data content the pad characters are removed (from the input document instance) or inserted (into the output document instance). Trailing pad characters are added to or removed from a field that is left justified, and leading pad characters are added to or removed from a field that is right justified. If the Pad Character property for a field is not set, no pad characters are added to or removed from that field.

    There ya go... just tested this and it's working as I need it to now.

    Mark

     

  • Hey Mark,

    For some reason the XSD doesn't show the spaces, but they will show up in the output or at least they do for me.

    I also find it difficult sometime to find info on BizTalk. I think the main reason is this BizTalk is a business to and therefore the user base is normally experience programmers who often receive training for the tool. Unlike Visual Studio itself, which is used in schools and by amateur programmers. That's why I am a member here and try to provide as many answers as questions I ask...trying to spread the knowledge :)

     

    Good Luck with future developing!
     

    Greg Smith

    BizTalk Admin

  • We are reciving the error as "Reason: An error occurred when parsing the incoming document: "Unexpected end of file has occurred. The following elements are not closed: ContentValue, Attribute, Attribute, WorkManagementUnitAttribute, WorkManagementUnit. Line 1, position 7904.".  It seems that there is a space in the XML file which is breaking the line and we get this error. But when we retry with same message it completes succesfully. Your help will be highly appreciated here

    Edit
Page 1 of 1 (6 items)