Page 1 of 1

using ${variableName:attributeName} in the body of an email

Posted: Fri Sep 07, 2018 4:32 pm
by fthomas
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

Re: using ${variableName:attributeName} in the body of an email

Posted: Mon Sep 10, 2018 10:00 am
by Support_Julie
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>