I have a scenario and need relevant solution to it
- bot logs on 1 SQL server, downloads data in format of excel
- reads the data and executes 1 query in SQL
- returns the output in excel
- bot copies this returned output to a VLOOKUP excel to generate the order number in column H
- bot filters on column I and whatevr is N/A , those order number have to be copied and again step 2 has to be executed
- then this process shd continue maximum thrice and then send email to support team.
- if at first chance only there is no NA in step 5, the bot has to send successful email
Can anyone help me?
You are looking for a full solution? or just any error or activity-related query
a crisp resolution
like what all can be done
1 Like
but how will it loop to step 2 or 3?
just keep those activity in loop body and max iteration to 3 or make condition which counts numbers of time loop executed
1 Like
Hello,
-
Use acitivty connet to database( Configure connection and then add Dsn, uid, pwd, provider name values ) and save the output to that acitivty.
-
Use the Run Query activity:
Set the Existing Database Connection property to the variable created in the previous step. Type your SQL query.The result will be returned as a DataTable. Save it in a variable.
-
Now you have the required data in the datatable. You can either apply the next steps directly on the datatable and then save it to an Excel file using Write Range Workbook activity or save the data first and then apply further steps.
-
Use the VLOOKUP activity in UiPath
-
Use any of these methods to filter rows:
Use Filter Data Table activity to filter rows where column I contains “N/A”. Or jsut use a LINQ query or For Each Row activity with an If condition to find rows with “N/A”.
-
After step 5, you have rows with NA values only, count those rows, if the count is 0 then just send a successful email. Else repeat the steps which you mentioned.
-
If your SQL query in Step 2 requires order numbers, extract all order numbers from column H (use a delimiter like a comma or any format that suits the query).
Also as @chandreshsinh.jadeja mentioned , keep those activity in loop body and max iteration to 3.
If you want to know anything in more details please let me know.
Thank You.