Forum Discussion

Szymon's avatar
Szymon
New Contributor II
5 years ago

Dynamic File Writer filename after XML Formatter possible?

Hello,

Is there a simple way, to pass filename to File Writer, after XML Formatter was executed?
In the Mapper:

  • filename shall be constructed into $filename. XML
  • JSON content for saving als XML shall be constructed into $content
    XML Formatter makes an XML out of JSON $content
    File Writer writes XML $content a file into $filename.

Can SL do such a sophisticated task?
I know that CSV Formatter e.g. can pass variables via header, but XML?

thank you & kind regards
Simon

5 Replies

  • Szymon's avatar
    Szymon
    New Contributor II

    Hi,

    This is what i came up with, without using some silly things like child pipelines passing filename as parameter. Splitting the execution, writing a file to some
    painintheneck.xml
    join paths and moving the file to the appropriate filename.
    Extremely annoying, so please if anyone has a shorter solution, post it here please.

    kind regards
    Simon

  • hope this will help you. configure the pipeline as in the image, in pipeline execute snap define the parameter name and capture it’s value from the mapper and declare the same parameter name in the child pipeline too and reference it in file writer snap.

  • Szymon's avatar
    Szymon
    New Contributor II

    Hi, as previously stated, I would like to avoid child pipelines, just because SL is not capable of doing that. Thank you though for your input.

    kind regards
    Simon