Skip to main content
Solved

Archiving the Imported File

  • November 23, 2025
  • 1 reply
  • 65 views

Hello,

 

I would like to archive the file which is imported in the first step of a flow after all connectors complete successfully. I attached a Script connector to the Success Path of the last connector and within the script:
1. Retrieve the name of the file from the message header

2. User the name to rename the file and copy it to the archive folder.
But I cannot retrieve the name from the message header.
Could anyone advise me how to do it?

Thank you.

Best answer by trapti2942

Hi,

If you want to move the processed file to an archive folder, you can first attach a Script connector as a initial connector and store the original filename in a message header. This ensures that even if the name changes later in the flow, the initial filename remains available. You can use a script like:

<arc:set attr="output.header:name" value="[FileName]" />
<arc:set attr="output.filepath" value="[filepath]" />
<arc:push item="output" />

After the flow completes, attach another Script connector and use the fileMove(https://cdn.cdata.com/help/AZM/mft/op_FileMove.html) operation to move the file from the original folder to the archive folder, for example:

<arc:set attr="input.source" value="D:\kk/[Header:name]" />
<arc:set attr="input.destination" value="D:\kk\archive/[Header:name]" />

<arc:call op="fileMove" item="input">
<arc:set attr="_log.info" value="The file [input.file:source], was moved to [input.file:destination]"/>
</arc:call>

If you have any further questions, you can reach out to us at [removed by moderator] .

This topic has been closed for replies.

1 reply

  • Answer
  • November 24, 2025

Hi,

If you want to move the processed file to an archive folder, you can first attach a Script connector as a initial connector and store the original filename in a message header. This ensures that even if the name changes later in the flow, the initial filename remains available. You can use a script like:

<arc:set attr="output.header:name" value="[FileName]" />
<arc:set attr="output.filepath" value="[filepath]" />
<arc:push item="output" />

After the flow completes, attach another Script connector and use the fileMove(https://cdn.cdata.com/help/AZM/mft/op_FileMove.html) operation to move the file from the original folder to the archive folder, for example:

<arc:set attr="input.source" value="D:\kk/[Header:name]" />
<arc:set attr="input.destination" value="D:\kk\archive/[Header:name]" />

<arc:call op="fileMove" item="input">
<arc:set attr="_log.info" value="The file [input.file:source], was moved to [input.file:destination]"/>
</arc:call>

If you have any further questions, you can reach out to us at [removed by moderator] .