How can we use the filepath,If we changed that path?


#1

Hi @ All,

I’m using one input file in my bot,If I will change the input file path
Then the bot will get error…
My question is It has to take the file path will be there in a particular folder or we changed
What we can do?


#2

Hi @varunk,

You mean to ask, if your file name gets change also bot should keep reading your file from a folder? No matter what file name is there.

Best regards,
Avi


#3

May be from the beginning, we should use some external file like config file to store paths, that may change?


#4

Hi @Avi7

Yes If I changed the input file also bot has to run
Is there any possibility to take file path automatically


#5

you’ll have hardcode at least one file path in your workflow. which contains file path such file will be Config.txt/xml/xlsx/json.


#6

Hi @Pankaj.Patil

kk


#7

Hi @varunk,

DEMO1.xaml (8.2 KB)

You have to hard code the directory or can give path of directory in Config file. This code is for “.txt” extension files. You can change according to your need by changing the extension in
assign activity “Directory.GetFiles(fileDirectory, “*.txt”)” .

Best regards,
Avnish