I am trying to get all the records of a database that meet a filter that I already defined. The problem with this is that I am having to repeat it N times depending on the n