Dear Team,
I have a Grid Field in which the data been populated from a Data Subset (Data from a Query Entity. I want to provide a text box ("Search") , where user will be searching items in the Grid.
My request is not to refresh the Data fetch every time, where as i want to search in the first time loaded data subset.
Please help with your solution...
Thanks in advance...
Discussion posts and replies are publicly visible
Can you explain why you don't want to re-query the data? It will likely be more efficient to re-query, because the database is better able to handle searching through a large set of data. Plus, if you use a!gridField() or a!localVariables(), your query will only re-execute if the search changes.
Am planning for Dynamic Searching, when user types something, it should search the relevant results immediately in the grid. And the cost to the DB should also be optimized.
How many rows do you expect to have in the database, and how many rows do you plan on displaying in the grid? Can you try to create an expression rule that will search in the database given a text string and check the performance? Unless you have a very small number of rows in the DB (<100), it's likely going to be a lot faster to re-query the data once the search changes.
I agree with Peter for the most part - the only way to really do what you're requesting here is to query an entire database table (at least the relevant columns for display) all into a local variable at load time, and then filter on that set when the user enters some filter value. This is, almost always, significantly less efficient for the DB and for the Appian environment than just doing a finely-tuned re-query when the user enters some filter value. The one exception being a case where a table will only ever have maybe 50 or 100 entries, and will not grow at all in the future.