If you have a new question you’d like our support staff to post a response to, please visit our customer community, GoAnywhere Insiders, to pose the question in our Discussion Boards. We have a thread “Ask Our Tech Experts” that our support team monitors on a regular basis, or you can start a new discussion where other GoAnywhere users and support staff can weigh in. Log in or create your new account at
https://insiders.goanywhere.com.
If you need an immediate response, please create a support ticket or contact our support team by email at
[email protected].
-
Malbanese
- Posts: 1
- Joined: Mon Nov 19, 2018 4:00 pm
Hello ~ I am trying to have a conditional statement that checks the data of a file and if it does not match the current system date to send me an email, otherwise the file gets SFTP to a vendor. I am having trouble with the syntax that checks the file date.
This is my "IF" condition:
${FileInfo('C:\Program Files\HelpSystems\GoAnywhere\userdata\webdocs\Temp\FULLUPBAL.CSV')}:lastModifiedDate < system.currentDate
Which throws this error:
[8046 - If: ${FileInfo('C:\Program Files\HelpSystems\Go...] Invalid condition syntax in attribute 'condition' of element 'if'. Unrecognizable character '}' found at position '87'.
Any help would be appreciated
-
Support_Jake
- Posts: 8
- Joined: Tue Jul 17, 2018 9:14 am
-
Your syntax is off just a little bit, and also I think you may be missing a timestamp task in your project. I have attached my XML for your example but most importantly below is the string I ended up using (Please replace with your full file name as mine is just for testing).
IF Condition:
${FileInfo('C:\Users\jacob.przybysz\Desktop\MFT Testing\custsample.csv'):lastModifiedDate < TimestampNow}
Code: Select all<project name="Check if File edited today" mainModule="Main" version="2.0" logLevel="verbose">
<module name="Main">
<print version="1.0">
<![CDATA[${FileInfo('C:\Users\jacob.przybysz\Desktop\MFT Testing\custsample.csv'):lastModifiedDate}]]>
</print>
<timestamp version="1.0">
<format outputVariable="TimestampNow" />
</timestamp>
<if condition="${FileInfo('C:\Users\jacob.przybysz\Desktop\MFT Testing\custsample.csv'):lastModifiedDate < TimestampNow}" disabled="false">
<print version="1.0">
<![CDATA[~~This was edited BEFORE the timestamp was taken~~]]>
</print>
<exitProject version="1.0" />
</if>
<print version="1.0">
<![CDATA[***This was edited AFTER the timestamp was taken***]]>
</print>
</module>
</project>