Skip to main content
November 22, 2023
Question

Convert queryEntity into batches/Looping

  • November 22, 2023
  • 1 reply
  • 0 views

I have below code. Can someone help how to break it into batches/looping in dynamic way. Its reaching threshold so i need to convert into batches/looping.

 a!queryEntity(
     entity: cons!MA_DSE_ABC,
     query: a!query(
       logicalExpression: a!queryLogicalExpression(
         operator: "AND",
         filters: {
           a!queryFilter(
             field: "Name",
             operator: "=",
             value: ri!name,
             applyWhen: not(isnull(ri!name))
           ),
           a!queryFilter(
             field: "Id",
             operator: "=",
             value: ri!id,
             applyWhen: not(isnull(ri!id))
           ),
         }
       ),
       pagingInfo: a!pagingInfo(startIndex: 1, batchSize: 2000)
     ),
     fetchTotalCount: true()
   ),

    1 reply

    stefanhelzle0001
    Brainy
    November 22, 2023

    If you run into any of the Appian limits, which are there for a reason, you should take that as a chance to rethink your design.