ForEach field is disappearing

Hi Team,

Word Invoice typed into the ForEach field is disappearing when I am replicating the below solution on my own. Any thoughts what I should do here?

It is not a declared variable, but Invoice is used in the Assign Activity below (see snip attached). InvoiceList is an array. The instructor in the video tutorial was able to replace currentitem with Invoice. I am not able to replicate that step.

Sessions: Control Flow in Studio (v2024.10)
Training: Automation Explorer (v2024.10)

Link to the solution:
https://academy.uipath.com/content/academy_/scorm/public/learning-plan/5TBgIcdGl4uggJbzLj9Pzz/37X8EetYxz8StC6H2fLVNu/yI7UoF4n86TDRWlbd1gzdv13sKAln6r4_SCORM2004.4_250708_v1/scormcontent/assets/Switch%20Solution.zip

Hi @Gulom

Could you please show what error messages you are getting?

Also, please explain your requirement. That will help us understand well and help you better.

Hi Sonali,

Below is the error message: “Argument ‘Value’: BC30451: ‘Invoice’ is not declared. It may be inaccessible due to its protection level. Variable ‘Value’ is missing. Please use Data Manager to recreate it.”

I took the requirement from the training session, which I was following.
"Let’s consider the following business case: we have the Invoices by Company Code folder that contains several invoices.

We want to separate the invoices into folders based on the company code specified in the file name.

To solve this scenario, we’ll create a workflow that gets all the files from the corresponding folder and loops through the files using a For Each activity. It then checks the last three characters of the file name and moves the files accordingly."

1 Like

Hi @Gulom

Thanks for sharing details.

Yes, it should be for each invoice in invoices list. Have you defined the variable that will refer the each element in loop? I don’t see anything in the screenshot. Under text box for for each, nothing is there.

Can you show properties of your for each?

@Gulom

Make sure you write variable ‘Invoice’ at the highlited field.

Hi @Gulom

What System package version is used in this process?