How to append filename with element from json?

i`m trying the example pipeline named “test_JSON_Formatter”
Json generator --> Mapper --> Json Formater --> File Writer

in Mapper i have:
Expression: _p_run_id.length != 0 ? $PAYLOAD.interface_id : $interface_id
Target path : $interface_id

in Json Formatter: i put nothing

In File Writer:

I want to append the filename with the content of the json element interface_id
i tried this c://temp//“test”+ $interface_id+".xml"
but it returns error : interface_id is not defined
Where shoud i define the interface_id?
How snaplogic gets its content from the json?
Thank you

Hi @2020,

Should you try and add an entry in the Binary header properties section of the JSON Formatter Settings, like so:

then you should be able to use it in the File Writer, like so:

Hope this helps.

1 Like

Hi @2020,

To be fair, I tested the solution in my previous response by writing to sldb.

So I see now that the path in the File Name property in my response won’t work, because the format differs from the one in the example in the File Writer documentation.

I don’t have access to the Groundplex of the organization I used to test my answer. So I can’t test by writing the file that way.

As for the SMB protocol, I do use it in my work, but the path I use has a valid URL of a company server.

My guess is, when you are trying to write to the file system on the Groundplex, perhaps you lack permissions, or you maybe even have a stray quote sign in your path.

I’m sorry I can’t be of more help.


1 Like

Thank you
it`s ok you can close this thread.