60
Views
4
Comments
Which is better to use local variable or Aggregates to populate dropdowns?
Application Type
Reactive

Hi team , I need to keep changing the values of 3  dropdowns based on previous selection of the other two . So which is better to use, aggregates or assign values to local and perform dynamic assignment to the local list in respect to performance. As far as i know , Use of Local list impacts view state and fetching data from server is slower than from local. So i am confused on which is better approach.

2019-04-09 00-57-55
carl ruhle

Hi @Sneha Kumari ,

When ever possible try not to query the db, would go to local variables. 

In my opinion and experience we should only access the db when we really need. 

Hope this helps you, regards. 

2023-10-31 07-36-11
Marlies Quaadgras
Champion

Hi @Sneha Kumari 

I think it really depends on how much data you expect to be in those 3 lists.

When the second and third list will not have so much results, you can keep keep it as local variables (list of structs, not records), and use the List functions to search

When you expect the second and third list come up with 100 or more records, the best solution is to get it directly from the database. When you have created an index on those tables , it would not take that much time.

Best regards, Marlies

2020-11-10 07-09-26
Dadi

Hi @Sneha Kumari 

The answer will be pros and cons, but I prefer use the List Filter in client side to avoid fetching database frequently

UserImage.jpg
sheetal patange

You can decide based on frequency of the data change. For example: data populating in second and third dropdown change consistently(alerted) then you can go for aggregate, where fresh data will get populate in dropdown.

 If second and third dropdown data is not changing frequently (may remain same for the period) then use local variable and filter.

Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.