Ideas

Lava Entity where parameter enhancement to allow 'in' a list

Lava Entity where parameter enhancement to allow 'in' a list

Lava

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 }}" %}
or an extension of ids where another parameter alters the underlying field used insead of Id, such as
{% ... ids:"{{ gtIds}}" idsparameter:"GroupTypeId" %}

Photo of Steve LipinskiSubmitted by Steve Lipinski, First Church of God of Columbia City  ·   ·  Lava
Login to add a comment...

Submission Success Tips

Cultivate your ideas for maximum impact with these helpful submission tips that will increase the chances of your brilliant concepts becoming reality.

  • Clear Title: Craft a straightforward and descriptive title that instantly conveys the essence of your idea.
  • Concise Description: Provide an idea description that is succinct, ensuring it effectively communicates the concept without unnecessary verbosity.
  • Provide Additional Details: With a concise description complete, now provide any other details that are needed to better understand the requirements.
  • Thorough Ministry Need Review: Provide a comprehensive overview of the ministry need your idea addresses, emphasizing its significance.
  • Cover the WHY: Clearly articulate the rationale behind your idea, explaining why it's essential and how it aligns with the organization's goals and mission. Oftentimes a clear "why" sheds light into other possible options.