Hi Diane
AFAIK, variable substitution will not work if the payload is converted to non-XML format at the receiver channel, by way of content conversion or IDoc/EDI conversion modules.
Due to the conversion, the payload is no longer in XML format, therefore at the point of variable substitution, it is not able to parse it as an XML.
For such scenarios, I normally use Dynamic Configuration in the message mapping to construct the filename and set it in the Filename attribute.
Rgds
Eng Swee