Hi @Jose Marin,
Are you copying the data from database to excel or excel to database?
As per your error details, you are getting the error at line 11 Database: Connect right? you want to ignore that and proceed but without proper connection to database how will you complete the process. First you need to make sure connection is established to DB or not.
The steps you are doing as per screenshot:
- Connect to DB
- Fetch data
- In loop: creating folders and then copying data to excel?
Could you please elaborate more.
Thanks,
Hemantha Pindra
Hi,
@HemanthaPindra
In BLUE you have my reply.
Are you copying the data from database to excel or excel to database?
I am copying the data from database to excel once a day (every day replacing the file ,just in case any modification)
As per your error details, you are getting the error at line 11 Database: Connect right?
yes, when the connection is lost I am getting “The provided connection details are invalid”
you want to ignore that and proceed but without proper connection to database
This would be the possible solution, ignore the error and then read the data from the excel file, contrary I can not continue.
how will you complete the process.
My idea was to call another different task identical to the existing one but reading the data from the excel instead of database as I have not connection to the database.
First you need to make sure connection is established to DB or not.
Yes, for sure, the main issue is getting connected to the database contrary I can not continue….. but if I can not continue with the database, then change the database to an excel file.
The steps you are doing as per screenshot:
- Connect to DB
- Fetch data
- In loop: creating folders and carrying another procedures according to the data got.
Thanks,
Jose Marin
Error Handling can do something like that, with the Connect action in the Try, the Catch would capture the line number (number variable) and the error description. Then in the catch you can have the condition to check if it meets your criteria. You’d want to properly close out of the task, closing any existing files and connections, to ensure the desktop is clear before try to do the Run Task. That would transfer control to the new task (getting data from a spreadsheet) you’d want to check how that task returns data, as after the backup process completes the control returns to the Run Task and finishes the bot from there.
My question is, can you determine the reason for the failed database connection?
What type of database are you connecting to? Excel as a DB?
If spreadsheet is more reliable, why attempt the database connection?
I have an idea like below.
Try
Try
assign flag = true
connect DB
Catch
if error does not null then
assign flag = false
if flag = true (DB connection success)
query to get data in DB session
export query data to data table variable
if flag = false (DB connection failure due to xxx reason)
open excel advanced
get multiple cells to get data into data table variable
(now data table variable either contain DB data or Excel data)
you can do loop of data table variable to do some validation and set into to excel file
Catch
Finally
if flag = true
disconnect DB
if flag = false
disconnect excel
Good morning,
Jon, this one of my ideas, this solution could be the best …
On the other hand, yes, I can determine the reason, the msg is “The provided connection details are invalid”, the databse is as SQL database, using the database instead of an excel file is that the DB is a shared one and managed by an application, with the quality control.
In any case, thks for confirming the idea.
Rgds.
Jose Marin