Join the #BuildWithBuildAgent Challenge! Get recognized, earn exclusive swag, and inspire the ServiceNow Community with what you can build using Build Agent.  Join the Challenge.

How to run the look up records in batches

Prithvi Ramesh1
Mega Sage

There are a total of 90,000 records in the sys_user table, which need to be used in a Lookup Records action. By default, the action retrieves only 1,000 records. How can we run the flow in batches to process all records each time it executes?

1 ACCEPTED SOLUTION

Ankur Bawiskar
Tera Patron
Tera Patron

@Prithvi Ramesh1 

what's your actual business requirement?

You can always apply some filter to reduce the records

OR

You can use Custom Flow Action and use GlideRecord there

If my response helped please mark it correct and close the thread so that it benefits future readers.

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader

View solution in original post

4 REPLIES 4

M Iftikhar
Tera Sage

Hi @Prithvi Ramesh1 ,

To handle all 90,000 sys_user records in Flow Designer, you must run the flow in batches, because Lookup Records has a 1,000-record limit. 

For more detail and patterns, see:

Thanks & Regards,
Muhammad Iftikhar
If my response helped, please mark it as the accepted solution so others can benefit as well.

Thanks & Regards,
Muhammad Iftikhar

If my response helped, please mark it as the accepted solution so others can benefit as well.

Mark Manders
Mega Patron

What's your use case that you need more than 1000 records returned in a flow action? Performing actions on that many records could become a performance issue. 


Please mark any helpful or correct solutions as such. That helps others find their solutions.
Mark

mayankkumar
Kilo Patron
Kilo Patron

Hi @Prithvi Ramesh1,
Please refer this article -> Process Large Data Sets Smoothly with Flow Designe... - ServiceNow Community
-------------------------------------------------------------------------------------------------------------------------------------------------
Please mark my response helpful and accept as solution
Thanks & Regards
Mayank

Ankur Bawiskar
Tera Patron
Tera Patron

@Prithvi Ramesh1 

what's your actual business requirement?

You can always apply some filter to reduce the records

OR

You can use Custom Flow Action and use GlideRecord there

If my response helped please mark it correct and close the thread so that it benefits future readers.

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader