Appian Community and Appian Academy are being upgraded. From July 24–August 3, the Appian Community will be in read-only mode. During this time, the site will be read-only and user registration will be disabled. We apologize for any inconvenience this may cause, but a more secure, stable, and performant Community experience is coming soon!

The new Appian Community launches August 3, followed by Appian Academy on August 7. During the migration, Appian Community Edition, Appian Academy, Documentation, Certifications, Instructor-led Customer Training, Partner Sales Training & Accreditation, and Forum (for Appian Partners and Customers only) will remain available.

Grid with filter?

Hi, I am trying to make a grid with filter above. I wrote this SAIL:
= load(
local!BUfilter,
local!pagingInfo: a!pagingInfo(
startIndex: 1,
batchSize: - 1,
sort: {
field: "InvestmentMain.InvID",
ascending: false
}
),
with(
local!datasubset: if(
isnull(
local!BUfilter
),
rule!getAllInvestments(
local!pagingInfo
),
rule!getInvestmentByBU(
local!BUfilter,
local!pagingInfo
)
),
a!dashboardLayout(
firstColumnContents: {
a!textField(
label: "Filter by Bu",
value: local!BUfilter,
saveInto: local!BUfilter,
refreshAfter: "KEYPRESS"
),
a!gridField(
totalCount: local!datasubset.totalCount,
columns: {
a!gridTextColumn(
label: "ID",
data: local!datasubset.data.InvestmentMain.InvID,
field: "InvestmentMain.InvID...

OriginalPostID-97336

OriginalPostID-97336

  Discussion posts and replies are publicly visible

Parents
  • Hello,
    I'm not sure about the specifics of this issue, but perhaps a change in construction could solve it and improve performance simultaneously

    Above it appears that you requery the database as the user types in the field. This could be very slow. If possible, I would recommend you move the query "getAllInvestments" up into the load() in a local variable called investments.
    Then, as users type in the filter try something like this inside the with()
    local!datasubset: if(isnull(BUfilter),investments,index(investments,where(apply(search(BUfilter,_),investments.InvestmentMain.BusinessUnit))))
Reply
  • Hello,
    I'm not sure about the specifics of this issue, but perhaps a change in construction could solve it and improve performance simultaneously

    Above it appears that you requery the database as the user types in the field. This could be very slow. If possible, I would recommend you move the query "getAllInvestments" up into the load() in a local variable called investments.
    Then, as users type in the filter try something like this inside the with()
    local!datasubset: if(isnull(BUfilter),investments,index(investments,where(apply(search(BUfilter,_),investments.InvestmentMain.BusinessUnit))))
Children
No Data