Vanquishing Technology!

Posts tagged ‘filename’

Did you know? (Setting output filename to a field value of the message without any custom code or orchestration)

I saw this question in the BizTalk newsgroups:

> Hi,

>  Is it possible to set the filename of a message with a value inside it

> which is available as a promoted property..

> I know this can be done using a custom pipeline component .But is there a

> way without it?

> I have no orchestrations in my solution..




Yes, it is possible!… here is how.

1. Right click on the schema node you want to promote, select Promote–>show promotions.

2. On the “property fields” tab, click on the folder icon (to add new property schema)

3. Expand the references, expand Microsoft.BizTalk.GlobalPropertySchemas and select  FILE.bts_file_properties.

4. Add your node as promoted and select ReceivedFileName in the property column as the property to which to promote to.

5. In the send port configuration use the macro %SourceFileName%

6. Don’t forget to use XMLReceive pipeline at the receive port.

That’ it! No custom pipeline no orchestration. This can be useful in content based routing scenarios where there are no orchestrations involved.

The XMLReceive pipeline will overwrite the source file name value in the context with the value of the field inside the message.