custom picker in Read only grid interface for huge data

Certified Senior Developer

I have a read only grid interface whose source is record data (API backed record).

Record holds 3 million data which is one time sync . 

If I need to implement two custom picker fields for two columns (ex: Year & Name, max selection is 5 ) and grid should reload even with combination filter as well. 

Please drop your suggestions to implement this without affecting the performance much.

  Discussion posts and replies are publicly visible

Parents
  • +1
    Certified Lead Developer

    Use aggregation queries in your suggest functions to fetch only distinct values (limited to 10 results) and require minimum 2 characters before searching.
    Use pagination (50 rows per page) and reset to page 1 when filters change.
    The key is that all filtering happens at the database level through the API-backed record, so Appian only processes small filtered result sets, not the full dataset.
    Example suggestion function code for your reference.

    /* Suggest Function Rule */
    a!localVariables(
      /* Query for distinct values using aggregation */
      local!results: a!queryRecordType(
        recordType: recordType!YourRecord,
        fields: {
          a!aggregationFields(
            groupings: a!grouping(
              field: recordType!YourRecord.fields.year,
              alias: "value"
            )
          )
        },
        filters: if(
          len(ri!searchText) > 2,
          a!queryFilter(
            field: recordType!YourRecord.fields.year,
            operator: "starts with",
            value: ri!searchText
          ),
          {}
        ),
        pagingInfo: a!pagingInfo(startIndex: 1, batchSize: 10)
      ),
    
      /* MUST return a!dataSubset with data and identifiers */
      a!dataSubset(
        data: index(local!results.data, "value", {}),
        identifiers: index(local!results.data, "value", {})
      )
    )


    For the picker field, use suggestFunction: rule!yourSuggestFunction(searchText: _)

Reply Children
No Data