cancel
Showing results for 
Search instead for 
Did you mean: 

Send FILE'S to ftp receiver with dinamic folder

brian_briones
Participant
0 Kudos

Hi Experts,

I have the next problem on PI 7.3.

I need create file on different folder, depend of company...

the first row must create on folder \COMPANY1\

the second row must create on folder \COMPANY2\

and the trhee....four...six...etc.

the target structure can be modify,no problem, but no have a idea for this request.

The FTP SERVER is the same... the folder is different only.

The Source file is:

BRIAN,COMPANY1

JULY,COMPANY2

RICHARD,COMPANY3

JESUS,COMPANY1

MAX,COMPANY2

and the Target structure is:

<row>

<head>company1</head>

     <person>brian<person>

     <person>jesus</person>

</row>

<row>

<head>company2</head>

     <person>july<person>

     <person>max</person>

</row>

<row>

<head>company3</head>

     <person>richard<person>

</row>

Regards Experts.

Accepted Solutions (1)

Accepted Solutions (1)

former_member182412
Active Contributor
0 Kudos

Hi Brians,

  • Create the sender and receiver structure like below and ignore the record set name in sender FCC.
  • Change the receiver occurrence to unbounded in signature tab.
  • Do the mapping like below for MessageType, Record, Head field.

  • Do the mapping for person filed like below.

  • Create the variable company in receiver file channel assign the head value from the payload and use it in target directory.

Regards,

Praveen.

brian_briones
Participant
0 Kudos

This is the complete solution.

Answers (2)

Answers (2)

Ryan-Crosby
Active Contributor
0 Kudos

Hi,

I think you would want to look into using a map to do message splitting along with variable substitution for the dynamic directory names.

Regards,

Ryan Crosby

former_member223322
Active Participant
0 Kudos

Hi Brian,

This is basically 1:n mapping. You should create multiple mappings one for each COMPANY and should call them in the interface determinations based on the condition.

For the below source file that you provided, you should create 3 message mappings & operation mapping. If atleast one row has the value 'COMPANY1' row, then 1st mapping should be triggered and that should map only the rows with 'COMPANY1' to the target structure. Similarly you should do for the remaining rows.

BRIAN,COMPANY1

JULY,COMPANY2

RICHARD,COMPANY3

JESUS,COMPANY1

MAX,COMPANY2

Hope I made it clear.

~Srini