List File Names and Not Exist Files

Is there a way to list file names containing and account for the file not existing without using IF THEN ELSE? The below statement does not work because the left side has to be singular.

(names of files whose (name of it contains "-TenancyActivationDate.complete") of 
folder "c:\support\TenancyCutOver") as string | "None"

I’m not sure I understand exactly what output you’re looking for, but if the concern is around how to avoid errors if the files and/or folders don’t exist, then you can simply pluralize them:

(names of files whose (name of it contains “-TenancyActivationDate.complete”) of folders “c:\support\TenancyCutOver”)

this seems to work.

(name of it) of (find file “-TenancyActivationDate.complete*” of folder “c:\support\TenancyCutOver”) as string | “None”

1 Like

Thanks Aram. That works. It returns <none> rather than <error> when a file is not found.

1 Like