Adding optional parameter to the function to create a data array from a path. The optional parameter is the filter parameter property which will give clearer error messages to the user.