I’m learning UiPath as of recent and came across the following failure of which message says the variable name is duplicated.
This errors occurs in step (2) where the reference variable is to be defined with the same name as (1).
(1) As is seen In the following logic, I used Use Excel File “Report” activity inside the Do of another Use Excel File “Acquisitions” activity, and defined “MonthReport” as a reference for the nested Use Excel File Activity
(2) In the next step, I used Use Excel File “Sales” activity and inside it, placed the another Use Excel File activity indicating the same Excel file as the referenced on in the previous step, and defined it with the same name, “MonthReport” as a reference variable.
Hello @hongjoo.choi ,
It may be caused by using the same scope reference name for 2 different operations.
Try changing its variable name like one with “MonthReport” and another with “MonthSalesReport”
For clarification, the variable is not something created from “CTRL+K”. It is a reference to the same excel file used inside each of “Use Excel File” activity of which flow is shown below. By nature, the reference variable doesn’t appear in the variable panel, therefor can’t change its scope by manual.
Each “Use Excel File” contains another “Use Excel File” inside its Do container with the same name referencing the same excel file.
This is from the UiPath Academy course on Excel Automation with Modern Experience. In the video of the Excel Data Consolidation exercise they use 3 Use Excel File activities and each time the “Reference as” is “MonthReport”. In the video they don’t get the error. If you try to recreate it, it gives the following error:
Use 3 different “Reference as” names. Then it will not give the errors
There’s a screenshot of the video where the error is not experienced, and a screenshot of my workflow where the error is experienced. Interestingly, if I download and execute the solution, it doesn’t throw the error and is developed exactly the same as when I throw the error. How can this be? In theory, if I received the error during development the pre-configured solution should also throw the exact same error.
I’ve received several errors like this is the trainings - how should these be reported?
Perhaps the downloaded solution contains references to older dependencies that didn’t trigger the error. Regardless, the course material should be amended to reflect the newer version of UiPath in my opinion, as what’s being done in the video in that specific module isn’t best practice.