AggregationFields and query filter how can in use together

Hi!

I need help!!!

I want to use  a!aggregationFields  and filter together how can i get it

  Discussion posts and replies are publicly visible

Parents
  • 0
    Certified Senior Developer

    That should not be an issue, you can try the below code and update your values and check.

    a!queryRecordType(
      recordType: "RecordType",
      fields: a!aggregationFields(
        groupings: a!grouping(
          field: "recordFieldToAggregateHere",
          alias: "xyz"
        )
      ),
      filters: a!queryLogicalExpression(
        operator: "AND",
        filters: {
          a!queryFilter(
            field: "fieldToFilter",
            operator: "=",
            value: true,
            
          )
        },
        ignoreFiltersWithEmptyValues: true
      ),
      pagingInfo: a!pagingInfo(startIndex: 1, batchSize: 100),
      fetchTotalCount: true,
      
    ),
    cast(
      recordType,
      null
    )

Reply
  • 0
    Certified Senior Developer

    That should not be an issue, you can try the below code and update your values and check.

    a!queryRecordType(
      recordType: "RecordType",
      fields: a!aggregationFields(
        groupings: a!grouping(
          field: "recordFieldToAggregateHere",
          alias: "xyz"
        )
      ),
      filters: a!queryLogicalExpression(
        operator: "AND",
        filters: {
          a!queryFilter(
            field: "fieldToFilter",
            operator: "=",
            value: true,
            
          )
        },
        ignoreFiltersWithEmptyValues: true
      ),
      pagingInfo: a!pagingInfo(startIndex: 1, batchSize: 100),
      fetchTotalCount: true,
      
    ),
    cast(
      recordType,
      null
    )

Children