cancel
Showing results for 
Search instead for 
Did you mean: 

Generating dynamic File name with extension .xml

PavanKumar
Active Contributor
0 Kudos

Hi,

We are working on scenario jdbc to sftp where requirement is generate a file name dynamically with extension .xml where file name receiving from the db in one field named as MESSAGEID in which i used dynamic configuration udf and enabled asma respective file name is generating.

But required file name with extension .xml how to in add in .xml to the field MESSAGE ID in the udf.

Please suggest

Regards Pavan

Accepted Solutions (1)

Accepted Solutions (1)

former_member186851
Active Contributor
0 Kudos

Hello Pavan,

In the UDF you can hardcode in the code +".xml"+ if the requirement like hardcoding .xml.

Answers (5)

Answers (5)

former_member190293
Active Contributor
0 Kudos

Hi Pavan!

You should set path to field inside your target structure as variable value.

For structure like:

<MT_Message>

<Header>

<Field1>value 1</Field1>

<Field2>Filename</Field2>

</Header>

</MT_Message>

variable value should be set like this:

MT_Message,1,Header,1,Field2,1

where the number after element name is the index of element in structure tree.

You do it for target structure.

No other actions like writting UDF required in this case.

Regards, Evgeniy.

former_member186851
Active Contributor
0 Kudos

Hello Pavan,

You hsould either of this not both.

PavanKumar
Active Contributor
0 Kudos

Hi all,

Thanks for ur reply it has been resolved in udf function i have added '.xml'

Regards

Pavan

former_member182412
Active Contributor
0 Kudos

Close the question then, Always close the question after its resolved the problem.

PavanKumar
Active Contributor
0 Kudos

sure Praveen. Thanks

former_member190293
Active Contributor
0 Kudos

Hi Pavan!

Just one addition to Praveen's and Raghu's answers: if you pass the value used as file name to target payload than you can use Variable substitution functionality of receiver SFTP adapter.

Define file name scheme as: %fname%.xml

Regards, Evgeniy.

PavanKumar
Active Contributor
0 Kudos

Hi Evgeniy,

In this case do i need to use dynamic file configuration

Do we need to give sender message type or receiver message type in reference tab.

vb.jpg

I have given receiver message type and got error.

error-vb.jpg

Regards

Pavan

former_member182412
Active Contributor
0 Kudos

Hi Pavan,

Use below reusable function library for dynamic configuration without writing every time.

Reuse FunctionLibrary for DynamicConfiguration and Message Header Attributes

Regards,

Praveen.