cancel
Showing results for 
Search instead for 
Did you mean: 

Pick files dynamically.

Former Member
0 Kudos

Hi Gurus,

Below is my requirement.

PI will first pick a .csv file. This file will contain multiple lines and each line will have six fields. Sixth field in every line will tell the name of a file present in same location as of the index file and this file can be a .doc, .xls, .jpg or mail. PI need to pick the file and send it as the attachment to message formed with the first five fields.

Through message split using mapping, we are sending each line's data in a separate message. But am not able to resolve how can I configure File Sender channel to pick a file whose name is sent in another message.

Please help with suggestions. Thanks.

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

Hi Uma,

You can go for custom adapter module for this case. Write the module to first read the index file, extract the first five fields from it, put it into a diff file and send it as the main payload. While, depending on the content of 6th field, read the additional file from source directory and send as attachment. This way, you do not need to do the splitting in mapping.

Regards,

Monika

former_member184681
Active Contributor
0 Kudos

Hi,

You won't be able to read this file with standard sender file Communication Channel features. Instead, you would have to extend its features using an adapter module, or read the additional files during mapping, for instance in a Java mapping or a UDF in graphical mapping.

Regards,

Greg

MichalKrawczyk
Active Contributor
0 Kudos

Hi,

1. just to add what Greg said - depending on the PI version you have you may not be able to handle attachments in the mapping but only in the adapter module (quick way to check it is to check if you have a flag in operation mapping which allows to read attachments)

2. there is also a way to do the sync file adapter with small efort with AXIS adapter but the efort is I'd say the same as of writing an adapter module 

Regards,

Michal Krawczyk