how change the outpur file name


  • Hi experts,

    i want send   output file name with  id , no  ,

    i have ouput file:






    Thursday, August 01, 2013 10:11 AM


All replies

  • If you are using orchstration/CustomPipelineComponent then change the promoted value  File.ReceivedFileName =  id+"_"+Number

    In Send port use macro: %SourceFileName%.xml

    Srikanth Peddy. MCTS-BizTalk Server Please mark as answered .

    Thursday, August 01, 2013 10:23 AM
  • Hi Anil,

    If you are using a Orchestration:

    • Access the ID and No from the message using XPath.
    • While constructing the outbound message, set some like the below:

    msgOutput(FILE.ReceivedFileName) = varID + varNo + “.xml”;

    here varID and varNo are the variable containg the ID and No values.

    • In the send port to use the macro %SourceFileName%.

    If you are not using an Orchestration:

    • Develop a custom pipeline component and set the context property of      the outbound message as follows:
    String strFileName = varID + varNo + “.xml”;
    outMsg.Context.Write("ReceivedFileName", "", strFileName);
    • In the send port to use the macro %SourceFileName%.

    Refer this article for more info: Set File Name dynamically using a Pipeline Component

    whole idea is to set to the context of the outbound message to your custom file name and set the file name in send port by using the macro - %SourceFileName% (which access the context File.ReceivedFileName). This works if you use send adapter like File, FTP etc where FILE.ReceivedFileName context exist.

    If this answers your question please mark it accordingly. If this post is helpful, please vote as helpful.

    Thursday, August 01, 2013 10:29 AM
  • ashwin,

    custompipeline give more complexity;;

    how is orch process only ?

    • Edited by anilraos Thursday, August 01, 2013 10:51 AM
    Thursday, August 01, 2013 10:42 AM
  • Hi anilraos,

    Seems like all the above responses are valid ones.

    If you are using orchestrations you can also promote the "id" and "no" elements as Distinguished Fields and then you can set the output file name as:

    • msgOutput(FILE.ReceivedFileName) = + + “.xml”;

    You can see more about Distinguished Fields vs. Promoted Properties here.

    And more samples of how to customize the output filename here:

    Sandro Pereira
    DevScope | MVP & MCTS BizTalk Server 2010 | @sandro_asp
    Oporto BizTalk Innovation Day | 14th March 2013 – Oporto, Portugal
    Please mark as answered if this answers your question.

    Thursday, August 01, 2013 10:45 AM