Something is wrong with my variable

I have successfully created my variables which appears in the variables tab. However, they are not stored when writing the name of my variable and it does not show that there is a mistake. Would you please help cause it has been bugging me for the past 2days.

@Eulo_Map
Welcome to the forum

maybe the scope is set too close.

It would be helpfully if you can elaborate more on detail along with some screenshots

1 Like

dont quote sourcePath variable as it has the meaning of string value

You can clearly see that when I type “Directory…” it directly gives me propositions of the different functions that I can use. However, when writing “sourcePath” nothing appears…

I dont understand

Try this;

Directory.Getfiles(sourcePath)

even though I want to get excel files only?

Do like: Directory.GetFiles(sourcePath) is taking the variable sourcePath

When Do like: Directory.GetFiles(“sourcePath”) we are providing the String Value sourcePath as Path to the method.

Directory.GetFiles(sourcePath, “*.xlsx”)

1 Like

@Eulo_Map

Write as Directory.GetFiles(sourcePath)

sourcePath is a Variable so no need of double quotes
If you have a string like the “C:\User\Documents” then you can write as

Directory.GetFiles(“C:\User\Documents”)

I did as you asked but when typing “sourceP” it still doest not give me the liste of variables and functions, this is actually what I am trying to understand

You can find below screenshot, I hope it will help you understand

Thank you, it helped a whole lot.