Parameterize Filter options in CSV Reader node

Hello guys.
I’m trying to do the same procedure from this link Parameterize Filter options in CSV Reader nodes

For filter my file, I just want to create a string variable to replace the filter file_name with a variable.
But I can’t at all.

Case:
In my folder I have 8 files but only one with “202209” in the name.

In my “filter options” I have only checked “File name”, write the name with wildcard character and checked again “Wildcard” = true.

The default procedure works fine.

Then I tried to create a string flow variable named " 202209 " and input in flow variable configuration.
Like:

After that I unchecked:

Then went to:

Result
My node is not working, and It’s reading all the files.
What I’m doing wrong?

From Brazil.

Leave that checked the value(s) will be replaced by the flow variable

Hello @Felipereis50 !

I did it, but its not working for me too.


image

But when I just write the filter, it works.

Check the filename (it needs to be set) and apply a pattern. It must be there. It will be overridden by the variable eventually.

Ensure the variable is applied properly as highlighted at the bottom of the configuration screen.

image

Hi @ArjenEX

Thanks for your answer!

All files in the folder follow the pattern of YYYY-MM-DD, I’m trying to filter only the files of 2023, and the variable is applied properly as in the print below.

Really don’t know what to do.

You need to fill something in for the File name:

Just use *2023*, the actual value will always come from the flow variable.

1 Like

Thanks again @ArjenEX, but still doesnt work :frowning:

The flow variable (string = *2023*) is applied properly but not overlapping what is written in the File name field, actually what is written in the File name field (*2022*) is overriding the Flow variable.

In the directory I am reading there are 18 files from 2023 and 76 from 2022, if the filter was coming from the Flow variable, 18 files would be being read, but actually the node is reading the 76 of 2022.

Well your screen is showing a 2022 filter so that is what i would expect.
br

What he writes is that it is being controlled by a flow variable, as shown in the bottom of the config, which has 2023 as value. So it should not matter whatever is written in the field itself.

1 Like

No @ArjenEX , what I’m saying is the opposite. It is not being controlled by the variable, but by what is written in the file name field.

If it was being controlled by the variable it would be reading 18 files as the variable is equal to *2023*. In the previous print it was reading 76 files because it was being controlled by what was written in the file name field.

For example if I write in the file name field *2024*, the node will not read any files in the folder

Hi Alan.
I achieved.
I tried again.
See print.

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.