Skip to main content
September 27, 2023
Question

Batching the query example with looping

  • September 27, 2023
  • 3 replies
  • 1 view

Can someone help with example. How to do batching in Query.

I have clear understanding of how it works but need clarity while implementing.

 Eg: create a query entity rule such as : a!queryEntity(entity: cons!entity, query: a!query(filters{whatever filters you want},
local!pagingInfo(startIndex: 1, batchSize: 100)
))

after this what i need to do?

I need to fetch 7000 records

    3 replies

    mathieud0001
    Brainy
    September 27, 2023

    https://docs.appian.com/suite/help/23.3/configure-record-data-source.html#syncing-in-batches 

    a!localVariables(
      local!batchSize: 100,
      local!startIndex: 1 + ((ri!batchNumber - 1) * local!batchSize),
      a!queryRecordType(
        recordType: 'recordType!{SYSTEM_RECORD_TYPE_USER}User',
        pagingInfo: a!pagingInfo(local!startIndex, local!batchSize)
      )
    )

    stefanhelzle0001
    Brainy
    September 28, 2023

    For what purpose do you want to load 7000 records into memory? In general, this is a bad practice and not recommended!

    itsm6335Author
    September 29, 2023

    I totally agree with your point [mention:126a676c85024855948336691b0a7b92:e9ed411860ed4f2ba0265705b8793d05] but when you are working on already built Application which is live, we cannot go ahead and follow all the best practice and latest features all of a sudden, we need to first make changes to existing code and make the Application work as expected. 

    So if you have solution to my question that will help me.