Resolution for error obtained in the Invoke Code activity "BC30002: Type 'XXXXX' is not defined", even after the variable is defined in the code snippet .
Approach #1: Import the namespace of the defined variable datatype by following the below steps:
- Navigate to the "Import" tab in the UiPath Studio
- Search for the namespace of the variable datatype that is used in the Invoke Code activity and select them.
Approach #2: Define the variable explicitly in the Arguments section of the Invoke Code activity as shown in the screenshot below, instead of declaring in the code snippet.