Skip to main content
April 26, 2022
Question

sorting in editable grid

  • April 26, 2022
  • 5 replies
  • 0 views

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
    April 26, 2022

    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

    April 26, 2022

    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
    April 26, 2022

    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
    New Participant
    April 26, 2022

    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>  )