Skip to main content
Known Participant
Apr 26, 2022 12:45 PM UTC
Question

sorting in editable grid

Hii @All,

 how we can apply sorting in an Editable Grid based on particular column selected by the user using a dropdown list. and  taking data from the database table using query entity.

    5 replies

    gopalk2865
    Participating Frequently
    Apr 26, 2022 1:33 PM UTC

    Hi, somebody else has also asked same question. please go through that post, link is below,

    https://community.appian.com/discussions/f/new-to-appian/24398/how-to-add-sorting-in-an-editable-grid

    Inspiring
    Apr 26, 2022 1:35 PM UTC

    Hi,

    When you query the data from database inside your query entity rule you have paging info. Inside this paging info you can sort the fields using sort field. So based on selected dropdown value update the sorting filed and re-evaluate your query logic.  

    mikes0011
    Brainy
    Apr 26, 2022 2:38 PM UTC

    Note that in the case of an editable grid, doing this would cause any unsaved user-side edits to get lost as they're overwritten by the re-query.  This is a good example for why I usually don't recommend sorting editable grids.

    The Expression Guru
    kunalt975958
    New Participant
    Apr 26, 2022 1:41 PM UTC

    Hi, You can pass the value selected in the dropdown as a parameter in the query itself.
                 a!pagingInfo(sort: a!sortInfo (field: <rule input>  ) )