I need to process files in the container using Azure Datafactory and keep a track of processed files in the next execution.

so I am keeping a table in DB which stores the processed file information,
In ADF I am getting the FileNames of the processed files and I want to check whether the current file has been processed or not.

I am Using Lookup activity: **Get All Files Processed**
to get the processed files from DB by using below query:

```
select FileName from meta.Processed_Files;

```

Then I am traversing over the directory, and getting File Details for current File in the directory by using Get Metadata Activity: **"Get Detail of Current File in Iteration"**

and in the If Condition activity, I am using following Expression:

```
@not(contains(activity('Get All Files Processed').output.value,activity('Get Detail of current file in iteration').output.itemName))

```

This is always returning True even if the file has been processed

How do we compare the FileName from the returned value

Output of activity('Get All Files Processed').output.value

```
{
"count": 37,
"value": [
    {
        "FileName": "20210804074153AlteryxRunStats.xlsx"
    },
    {
        "FileName": "20210805074129AlteryxRunStats.xlsx"
    },
    {
        "FileName": "20210806074152AlteryxRunStats.xlsx"
    },
    {
        "FileName": "20210809074143AlteryxRunStats.xlsx"
    },
    {
        "FileName": "20210809074316AlteryxRunStats.xlsx"
    },
    {
        "FileName": "20210810074135AlteryxRunStats.xlsx"
    },
    {
        "FileName": "20210811074306AlteryxRunStats.xlsx"
    },

```

Output of activity('Get Detail of current file in iteration').output.itemName

```
"20210804074153AlteryxRunStats.xlsx"

```