I am studying Automation Explorer Plan in UiPath Academy and currently on the “Build your first automation process with Studio (v2024.10)” module.
While following along the tutorial, I got stuck with the error, BC30451: ‘SalesByStore’ is not declared. It may be inaccessible due to its protection level. Variable ‘SalesByStore’ is missing. Please use Data Manager to recreate it. Main.xaml
while the instructor did not.
The Issue stemmed from the “New table name” field. I tried closing and reopening UiPath Studio to resolve the issue, as well as adding a new “Create Pivot Table” activity and deleting the old one, but I still faced the same error. Then I tried creating the variable “SalesByStore” manually and tried with Data Type “Data Table” but then the following error. BC30311: Value of type ‘DataTable’ cannot be converted to ‘String’. The selected value is incompatible with the property type. Main.xaml
I tried to changing the data type to string but then faced with the issue “cannot have null value”. Then I provided a random string to the variable as Default Value and then it worked.
Now even though the error has been resolved, I have absolutely no idea why the error occured? Why it resolved like that? And why did the instructor not receive the error?
Regarding BC30451 :
This is dotnet error which indicate the variable is not declated or you have declared the varaible but the scope is other than the present scope.
In Studio, you need to first declare the variable to use it.
Regarding BC30311:
In Excel, table name is always a string. Hence passing varaible with datatype as DataTable is invalid.
cannot have null value: Table name is a mandatory field in Excel Pivot activity. Hence you cannot pass null value.
Hope this solves your queries
If yes, kindly mark as solution.
This depends on the lots of things like Studio version, Excel, System Package versions etc. With the difference in your setup and the instructors setup because of that you got the error but the instructor didn’t. In your setup the New table name property considered value you entered as a variable (This is the reason you got the error) but for your instructor, it was considered plain string value.
UiPath have recently updated the user experience which results in this kind of confusions.
Here is how you can pass the string value directly.
Thank you so much. Cannot believe the solution was something this simple.
It also explains why it accepted a variable containing a non-null string as a valid Table Name. It was a roundabout way of doing it, when it can be done directly.