Use set for getFields
Use count function
Filter params and output before use. Use Enurmerate to count rows