Add new filter to template view

Hi, I have a problem with my script. I want to add new filter to view template, but in my code I have a problem with “Parameter by name”, when I click run I can see in revit filter that numbers of rules as the same as all elements in categories.

I know that problems is connecting with elements which I choose but I have no idea how to do it in another way

You can use x[0] to get only one element from workset parameter, since all of them are “Workset” parameter.