Populating a Variable using other variables and a function
Post any question you may have in regards to GoAnywhere Director and let our talented support staff and other users assist you.
3 posts
Page 1 of 1
I am trying to create a list of files that have been processed to be included in an email when the process is complete. The logic to populate the variable is within a loop.
I am expecting- TEST22.txt, TEST23.txt, TEST24.txt, TEST25.txt
This is the code that I have but it is not producing the desired results.
<setVariable label="Populate ListofFiles Variable" name="ListofFiles" value="Concat(${ListofFiles}, ${Currentfile:name})" version="2.0" logLevel="debug" />
The above code is producing the following
Concat(Concat(Concat(Concat(TEST22.txt, TEST23.txt), TEST24.txt), TEST25.txt)
Thank you for your assistance.
I am expecting- TEST22.txt, TEST23.txt, TEST24.txt, TEST25.txt
This is the code that I have but it is not producing the desired results.
<setVariable label="Populate ListofFiles Variable" name="ListofFiles" value="Concat(${ListofFiles}, ${Currentfile:name})" version="2.0" logLevel="debug" />
The above code is producing the following
Concat(Concat(Concat(Concat(TEST22.txt, TEST23.txt), TEST24.txt), TEST25.txt)
Thank you for your assistance.
- Support Specialist
- Posts: 590
- Joined: Tue Jul 17, 2012 2:12 pm
- Location: Phoenix, AZ
-
Amos,
Try something like this:
Try something like this:
Code: Select all
**NOTE** This assumes you are on GAD Version 4.0+ and have upgraded your Project to Version 2.0<setVariable label="Set: ListOfFiles" name="ListOfFiles" value="${system.emptyString}" version="2.0" logLevel="silent" />
<forEachLoop label="Get ListOfFiles" itemsVariable="${MyFileList}" currentItemVariable="MyFile">
<setVariable label="Update: ListOfFiles" name="ListOfFiles" value="${Concat( ListOfFiles, MyFile:name, system.carriageReturn ) }" version="2.0" logLevel="silent" />
</forEachLoop>
<print label="(Status) Print List" version="1.0">
<![CDATA[
==========================
${ListOfFiles}
==========================]]>
</print>
Rick Elliott
Lead Solutions Consultant
(402) 944.4242
(800) 949-4696
Lead Solutions Consultant
(402) 944.4242
(800) 949-4696
3 posts
Page 1 of 1