Hello! I’d create an Observable for the Rectangle’s Visibility value. This value would be determined by the items position in the array. For the last item it would be “Collapsed” and “Visible” for others.
Not a working snippet but an idea:
// this would happen in the loop you add items
item.rectangle_visibility = (items.indexOf(item) == items.length-1) ? new Observable(”Collapsed”) : new Observable(”Visible”);
// then in the UX part of Each you add Visibility={rectangle_visibility} for the Rectangle