No, you have to generate a new collection. Also keep in mind that even if you generated a new collection of kvps, it won’t be able to be set on the entity. It would just be for use later on in your jinja template.
If you’re just filtering it out, real quick and dirty way to do this…
Keep in mind that this is advanced Jinja. So there’s a bunch of key things you’ll need to learn about to understand it. I.e. what an attribute is on an object, what a test is.
Because you need to understand what a test is and what selectattr is doing with the test. I.e. selectattr accepts a variable number of arguments and those are passed to the test. This is shown in the example with 2 arguments and it’s described in the input types.
Their example is good, it shows a test and how it’s used, and then the same thing with selectattr.