# FileExists (String filePath)

| **Name**    | ***FileExists***                                                                           |
| ----------- | ------------------------------------------------------------------------------------------ |
| Syntax      | FileExists (String filePath)                                                               |
| Purpose     | To check and return either ‘True’ or ‘False’ depending on whether a specified file exists. |
| Description | Checks whether a file exists.                                                              |
| Return Type | Boolean                                                                                    |
| Parameter   | filePath \[System.String] – Path of the file to check.                                     |

![](https://3083465318-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FsR50Wa7EwZGlmPSAMkkf%2Fuploads%2FA7BeHgvgyqwXp96IQMVJ%2F0.png?alt=media)

**Example**

In this example, we are passing the required parameter to the function transformation object using a *Variables* object. We will be checking for an existing file.

Where,

*filePath* = *C:\Users\Kanwal.Azim\OneDrive - Astera Software\Desktop\Functions Documentation\Files\File Exists\FileExists.docx*

![](https://3083465318-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FsR50Wa7EwZGlmPSAMkkf%2Fuploads%2FvFWS9cjr0KPcpSC2X9qQ%2F1.png?alt=media)

Right-click on the function transformation object and select *Preview Output.* As you can see, Astera Data Stack has returned the Boolean value “True”, as this file does exist.

![](https://3083465318-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FsR50Wa7EwZGlmPSAMkkf%2Fuploads%2FBoHZAyWH6YsznKB7EqTI%2F2.png?alt=media)
