How to sort looped items in Documint

Поделиться
HTML-код
  • Опубликовано: 18 окт 2024

Комментарии • 7

  • @allenmoldovan846
    @allenmoldovan846 2 года назад

    IS there anyway to group the table by a common field view. Akin to airtable's in grid grouping functionality?

    • @Documint
      @Documint  2 года назад

      Hi Allen, you sure can. We're still working on the documentation for the $group function but you it's currently available for use. The way to use it is is by assigning the output to a new variable like so
      {{$var "grouped_items" ($group line_items "category")}}
      This will create a new variable called "grouped_items" that contains the groups of line_items. You should place the function in a section at the top of your template and then repeat another section on "grouped_items". Within that section you can display the name of the group with the {{name}} token and loop over the items in that group by adding a row which you repeat on the "items" variable. Within that row you can add columns and text elements where you display the values of fields in the Line Items table. I hope this makes sense. You can also inspect the structure of the data outputted by the $group funciton by using the $inpect function like so
      {{$inspect grouped_items 3}}
      where 3 is the depth of detail that you want to display.

    • @allenmoldovan846
      @allenmoldovan846 2 года назад +1

      @@Documint Figured it out, thank you for the pointers!!!

  • @dimitrisgoudis1603
    @dimitrisgoudis1603 10 месяцев назад

    Hey @documint, how could sort by a text field or by a date?

    • @Documint
      @Documint  10 месяцев назад

      @dimitrisgoudis1603 This should be the same process, you just choose the field you want to sort by and choose ascending or descending, just note that the filed name should be added as the variable style like this my_variable NOT My Variable and you should be good to go

  • @RosieWolkind
    @RosieWolkind Год назад

    Is there a way to sort looped items by a date field?

    • @Documint
      @Documint  10 месяцев назад

      This should be the same process, you just choose the field you want to sort by and choose ascending or descending, just note that the filed name should be added as the variable style like this my_variable NOT My Variable and you should be good to go