Ideas

Lava 'Person Filter - Children' to have option to sort the returned list by age

Lava 'Person Filter - Children' to have option to sort the returned list by age

Lava Complete

The Person Filter - Children lava does not return a list of children sorted by age.  It would be helpful to be able to specify an option to return the list unsorted by age, sorted by age increasing (default), sorted by age decreasing.  

Photo of Ken Roach Submitted by Ken Roach, Porirua Elim Christian Centre  ·   ·  Lava
Photo of Nick Airdo Complete Nick Airdo, Spark!  · 

We updated the Children Lava documentation to note the possibility of using array filters to achieve this.

Ministry Strength 1 / 5
Login to add a comment...

  • Nick Airdo

    Hi Ken, we think the Shuffle, Sort, OrderBy array filters can solve this need nicely. We added a note to the Children filter to highlight that possiblity.


    {% assign rand = Person | Children | Shuffle %}
    {% assign childrenYoungToOld = Person | Children | Sort:'Age' %}
    {% assign childrenOldToYoung = Person | Children | Sort:'Age', 'desc' %}

  • Ken Roach

    This can already be achieved by the following lava, so this idea can probably be closed.


    {% assign children = Workflow | Attribute:'Person','Object' | Children | OrderBy:'BirthDate desc' %}
    Children are:
    <ul>
    {% for child in children %}
    <li>{{ child.FirstName }}, {{ child.BirthDate | Date:'dd/MM/yy' }} </li>
    {% endfor %}
    </ul>