There's your issue. When you do " index(local!data, "columnName", null()) ", then when the data subset is empty it will return a single (null) value, causing the error you saw. What you would want to do instead is " index(local!data, "columnName", {}…