cancel
Showing results for 
Search instead for 
Did you mean: 

Using variable for file naming only and not in xml payload?

acesario
Contributor II

I’m formatting and writing an xml file, and would like to name the file based on a field value from the original file, but cannot be part of the xml. Is it possible to somehow bring a variable ($VAR) from a prior step in to the File Writer without including it in the preceeding XML?

‘response-s-’$VAR’+‘-.xml’

image

1 ACCEPTED SOLUTION

Supratim
Contributor III

@acesario You can segregate xml format and file writer in different pipeline, then call this child pipeline using Pipeline execute and pass input param(the filename you want ) from your parent pipeline. Even if you use xsd inside xml format, you can found the xsd structure from the mapper(Map to xml) of your parent pipeline.

View solution in original post

5 REPLIES 5

acesario
Contributor II

@Supratim, I found a way to resolve this. I used a GATE snap on the parent to combine the rows, and a json splitter on the child along with the parameter for the file naming.
WORKS PERFECTLY! Thank you for the continued conversation and ideas.