Skip to main content
February 20, 2023
Question

Memory Threshold issue when filter large size data from DB- Any solution

  • February 20, 2023
  • 8 replies
  • 1 view

In my application, the DB contains the fields (id,name,unit,type,isActive). The name and unit values are retrieved based on the type and shown in the UI dropdown and that is the List.

One Particular type contains 13000+ active records and gives Memory Threshold issue when it tries to load the data. In the expression rule, the batch size as set as -1 to retrieve all the data's from DB. 

To avoid this exception, I added the batch size as 100 in a!pagingInfo(). But the problem is now able to see only the 100 records in dropdown field and not all the 13000+records.

 Is there any other option is available to resolve this problem.

Regards

Martina

    8 replies

    stewart.burchell
    February 20, 2023

    Hi Martina

    A single drop-down with 13000+ records is pretty unwieldy. You might want to consider some alternate patterns:

    • Can you categorize the data so that you can have two related dropdowns, the first to pick a category and the second to pick from a subset of the records that are in the selected category? For example: you might have a list of cars, so the first category might be the manufacturer of the car and the second the specific model.
    • Do your users have any pre-knowledge of what might be in the list? Could you use a custom picker component and let the user type into it something that would return a subset of the records?
    February 20, 2023

    Thank you, Stewart.

    Unfortunately, not able to categorize the data right now.

    In actual the Custom Picker field should be implemented in the Row List. But I tried with Single Custom Picker field.

    While search, the filter shows only value "1" and throws the exception when the value is selected.

    Code Snippet:

    a!localVariables(

      local!selectedName,

      local!selectedRecord:rule!DSC_GetProductNameByType(cons!DSC_CONS_PRODUCTTYPES[2]),

      local!recordLabels: local!selectedRecord.productName,

      local!recordValues: local!selectedRecord.id,

      a!sectionLayout(

        contents:{

          a!pickerFieldCustom(

            label: "Product Name",

            placeholder: "Enter Name",

            maxSelections: 1,

            suggestFunction: rule!ucArrayPickerFilter(filter: _, labels: local!recordLabels, identifiers: local!recordLabels),

            selectedLabels: a!forEach(

              items: local!selectedName,

              expression: index(

                local!recordLabels,

                wherecontains(

                  touniformstring(fv!item), 

                  touniformstring(local!recordValues)

                )

              )

            ),

            value: local!selectedName,

            saveInto: local!selectedName

          )

        }

    )

    )

    stefanhelzle0001
    Brainy
    February 20, 2023

    The trick with the custom picker is, to put the database query inside the suggest function.

    achutaharshavardhanv6069
    February 20, 2023

    Hi Martina,

    Did you try to create a record type on this and call this data from the record picker as that is very fast. i had the same issue but when i turned that to a record picker it was fast.

    February 28, 2023

    After using casting also, couldn't get the values in the desired format and only null values.

    local!test:

    stefanhelzle0001
    Brainy
    February 28, 2023

    What are we looking at here? When you read the documentation here

    https://docs.appian.com/suite/help/22.4/Custom_Picker_Component.html

    https://docs.appian.com/suite/help/22.4/recipe-configure-an-array-picker.html

    This includes all required info.

    When you explain what you tried and provide some code snippets, we can support you in a better way.