I want to extract a UK postcode from a free-format address field, but only if there is one.
I am using the AttributeManager transformer with a new output attribute value:@Substring(@Value(OriginalAddress),@FindRegEx(@Value(OriginalAddress),";A-Z]]A-Z]]0-9]]0-9] 0-9]]A-Z]]A-Z]"),8)
This works but I am getting unwanted results where a UK postcode is not found.
An important point is that OriginalAddress is a derived output attribute: @UpperCase(@Value(OccAddress1) @Value(OccAddress2) @Value(OccAddress3) @Value(OccAddress4) @Value(OccAddress5))I would like to say something on the lines of: If there's a postcode then get postcode else don't bother.Is this possible without resorting to using a python transformer? Trying to set a Conditional Value in AttrubuteManager does not work in this case as only the original input attributes are recognised in the Output Values builder of the Test Conditions (that is, it's only seeing the OccAddressN fields).