I am working on Practice 1: For Each and If questions and I am not able to generate the correct max and min value for the practice. I’ve followed their solution steps and reviewed the downloaded file from the practice.
I am getting an error in the For Each activity where “Element” in the If condition is giving me error BC30389. and if i set “Element” as a variable, the workflow generates incorrect max and min values.
Below are the steps from UiPath Academy solution steps
- Use a For Each activity to go through each item in the array: For Each Element in InitArray
- Drag two If activities inside the body of the For Each:
- Set the condition for the first If to “Element < MinValue” to compare the values in the array and identify the smallest. Inside the Then block, add an Assign activity to assign Element to MinValue.
- Set the condition for the second If to “Element > MaxValue” to compare the values in the array and identify the largest. Inside the Then block add an Assign activity to assign Element to MaxValue.
Can someone advise how can I fix the workflow to generate the correct max and min value?