a!gridColum - filter data

There is a rule within my interface that queries an entity and returns data into a grid. I want to filter the data and only show account info with an approval_status of "A". I will also create another grid and show the accounts with an approval_status of "P". I am not sure how to filter to get what I am wanting in the 2nd grid column below

a!gridField(
data: local!worksites,
columns: {


a!gridColumn(
label: "Account Number",
sortField: "account_maintenance_number",
value: fv!row.account_maintenance_number,
align: "START"
),


a!gridColumn(
label: "Approval Status",
value: fv!row.approval_status

  Discussion posts and replies are publicly visible

  • 0
    Certified Lead Developer

    Usually you'd do such filtering within the query - can you share some details about how you're querying here?

  • 0
    Certified Lead Developer
    in reply to Mike Schmitt

    That would be my recommendation as well.  Form one queryEntity to gather only the "A" grid, then copy paste do another queryEntity for the "P" grid.  Especially if there are rows that are neither P nor A, you avoid pulling those from the database, and even running the query twice it might wind up more efficient.

    (Queries run a lot of overhead up front and scale logarithmically, so you have to eliminate a lot of rows before it's really MORE efficient to pay the upfront time cost twice, but it's probably so close as to not worry about it.  You can always benchmark and see.  And no matter what, if you return even 1 less row you save RAM.)