Error
Currently, Lava entity commands allow for a where parameter with a multitude of conditions, such as ==, !=, <, >, etc...
It would be nice if there was the equivalent of an 'in' (like in a list/array represented as a comma-separated list), along the lines of how the ids: parameter works.
Two common use-cases I can think of:- Given a Person, trying to find all entities for that Person when the entity links to the PersonAlias and not the Person - you can pass all the aliases for that person into the filter:
{% assign aliasList = CurrentPerson.Aliases | Map:'Id' | Join:',' %}{% registrationregistrant where:"PersonAliasId in {{ aliasList }}" %} You are registered for the following things: <ul> {% for r in registrationregistrantItems %} <li>{{ r.Registration.RegistrationInstance.Name }}</li> {% endfor %} </ul>{% endregistrationregistrant %}
- Trying to filter entities by a set of particular Types:
{% assign gtIds = '3,5,6' %} {% group where:"GroupTypeId in {{ gtIds }}" %} Groups with Type 3, 5, or 6: <ul> {% for g in groupItems %} <li> {{ g.Name }} {% endfor %} </ul> {% endgroup %}
I realize that this may be difficult to do with strings, especially if you have to escape commas, etc. Maybe this functionality could be limited to integers only as filtering based on Id-based fields would arguably be the most common use.
Some alternate approachs (depending on how easy to code) could be a new entity filter parameter such as
{% ... wherein:"GroupTypeId,{{ gtIds }}" %}
{% ... ids:"{{ gtIds}}" idsparameter:"GroupTypeId" %}
Cultivate your ideas for maximum impact with these helpful submission tips that will increase the chances of your brilliant concepts becoming reality.