When trying to loop through email messages to get the date and content, I’m getting the error below:
‘VisualBasicValue’: Compiler error(s) encountered processing expression “currentItem.From”.(2) : error BC30451: ‘currentItem’ is not declared. It may be inaccessible due to its protection level.
“currentItem” is my Item Name in the For Each loop (i.e.: "For Each currentItem). I don’t have it declared anywhere else as a variable. I’m using UiPath Studio.
currentitem scope will be only inside for loop..outside it might not be accessible
in latest for loop activities generally the name is dynamic based on the value you rpovide in input..for example for mails it generally will be currentmailitem..so better check the name properly ..in any field use ctrl+space to get the available values\
It was currentMailMessage by default, but I was getting the same error with that. I’m following a tutorial, so I changed it to match and I’m still getting the message with the new item name. I verified that the item name changed to match in the body of the For Each loop as well.
It’s very basic so far. It’s the Working with App Integration activities page of the Email Automation With Studio section of the Automation Developer - Specialized AI Professional Training course here on UiPath.com. So far, it just gets emails that match an incident number then tries to pull the date and content and fill an audit log. It uses UiPath.Mail.Activities. I’m using the v2.1.0-preview build.