cancel
Showing results for 
Search instead for 
Did you mean: 

using prefixfor filename using mapper output view's pass through option

Gitanjali
New Contributor II

Sharing a part of my whole pipeline flow is:

Router snap --> oracle_execute snap (fetches data from oracle db via slect statement) --> mapper --> csv formatter --> file writer

The mapper input view is of the format:

[

  {

     "key1": "Key1",

      "key2": "Key2",

      "key3": {

             "subkey1": "sub key 1"

        }

  }

]

I want to create csv file using fields: "key1" and "key2".

However, I want to use the field: "key3"."subkey1" in file_writer snap to use as suffix in filename. 

If I select the pass through option in mapper and create target schema mapping only for key1 and key2; the csv formatter snap fails saying that flattened input is required.

 

How can I resolve this?

 

1 REPLY 1

Aleksandar_A
Contributor III

Hello @Gitanjali,

One approach would be to wrap the File Writing part in a child pipeline and pass the file name as a parameter from the parent.

Attached below I'm providing you an example pipelines.

Please let me know if this helps you!

Regards,

Aleksandar.