I have an email that I am trying to list the names of the files in a file list variable. When I use ${filelist:name} it errors with: Method 'getName' or 'isName' not found on class 'com.linoma.dpa.util.FileList'. Original expression: retfiles:name.
Is this not acceptable in the body of an email?
Thanks
using ${variableName:attributeName} in the body of an email
Post any question you may have in regards to GoAnywhere MFT and let our talented support staff and other users assist you.
If you need a quicker response, please create a support ticket via the customer portal my.goanywhere.com or contact our support team by email at [email protected].
If you need a quicker response, please create a support ticket via the customer portal my.goanywhere.com or contact our support team by email at [email protected].
- Support_Julie Offline
- Support Specialist
- Posts: 91
- Joined: Thu Mar 05, 2009 3:49 pm
- Location: Ashland, NE USA
- Contact:
Re: using ${variableName:attributeName} in the body of an email
You can use the file list variable in the email message body without the file attribute (name). That will give you a list of the files that include the folder path.
${retfiles}
If you do not want the path information, then you can create a temporary print file.
You would need to do a For Each loop thru the file list.
Using the PRINT task, write the file name to a temporary file: ${retfiles:name}${system.lineFeed}
Then using that temporary file, Add a File to the message body.
for example:
<forEachLoop itemsVariable="${retfiles}" currentItemVariable="CurrentItem">
<print file="${system.job.workspace}TempFile.txt" version="1.0">
<![CDATA[${CurrentItem:name}${system.lineFeed}]]>
</print>
</forEachLoop>
<sendEmail resourceId="HelpSystem" toList="[email protected]" keyLocation="KeyVault" version="2.0">
<from address="[email protected]" keyLocation="KeyVault" />
<subject>
<![CDATA[test]]>
</subject>
<message file="${system.job.workspace}TempFile.txt" />
</sendEmail>
${retfiles}
If you do not want the path information, then you can create a temporary print file.
You would need to do a For Each loop thru the file list.
Using the PRINT task, write the file name to a temporary file: ${retfiles:name}${system.lineFeed}
Then using that temporary file, Add a File to the message body.
for example:
<forEachLoop itemsVariable="${retfiles}" currentItemVariable="CurrentItem">
<print file="${system.job.workspace}TempFile.txt" version="1.0">
<![CDATA[${CurrentItem:name}${system.lineFeed}]]>
</print>
</forEachLoop>
<sendEmail resourceId="HelpSystem" toList="[email protected]" keyLocation="KeyVault" version="2.0">
<from address="[email protected]" keyLocation="KeyVault" />
<subject>
<![CDATA[test]]>
</subject>
<message file="${system.job.workspace}TempFile.txt" />
</sendEmail>