Search code examples
biztalkbiztalk-2013

how to replace value of field when field is empty?


On my left schema, sometimes for the StartTime we will have no value whatsoever. Some examples of valid values would be:

1200
1320
2100
0900

When the input is blank, simply <StartTime></StartTime> the output I'd like to have is midnight, or <StartTime>0000</StartTime>

I understand that I can do this through a regular scripting functoid, but is this possible to do without code?

Are there functoids which simply replace the original contents of the field with something else, allowing for further processing?


Solution

  • Sure, just use a combination of Length+Equal/Logical Not/Value Mapping Functiods to pass either the received value (Length != 0) or 0000 (Length = 0).

    Length -> GreaterThan(0) -> Value Mapping/Source -> Target

    --and--

    [Length -> GreaterThan(0)] -> LogicalNot -> ValueMapping/"0000" -> Target