Using Pagination to Return Certain Amounts of Data
Comments
-
I am creating a flow to allow other systems to retrieve data from Decisions. To avoid a large data transfer, I plan to implement the Pagination feature based on last ID of a previous call. The other system will invoke my flow with the last ID of the previous call then my flow will retrieve 500 records starting from the last ID. Is there any way to implement this?
-
The best course of action here would be to use a Raw SQL step to call the records. You can use the SQL Query below to do this:
select entity_name as name, full_path, * from entity_folder
order by entity_name desc
offset @offset rows fetch next 10 rows onlyFirst, create a SQL Query step by navigating to a Designer folder > Create Datastructures/Integreations > Database Integration > Add Query
[color=rgb(127, 140, 141)][font=Roboto][img]att1[/img][/font][/color]From here choose the database you would like to run the query on, and click Next.
[color=rgb(127, 140, 141)][font=Roboto][img]att12/img][/font][/color]Name your query, then add the SQL steps above. You will see the @offset option appear in the input parameters. Click the pencil icon beside the @offset within the field.
[color=rgb(127, 140, 141)][font=Roboto][img]att3[/img][/font][/color]
Add a Default Value of 0 and set the type to int32.
[color=rgb(127, 140, 141)][font=Roboto][img]att4[/img][/font][/color]Click Ok and then navigate to the flow designer
Create a flow and add a For Loop step with your interaction. Then attach this to a Multiply step. In my example, since I want 100 records, I will set my iteration to 10 and multiply it by 10. This way my flow will loop 10 times, and pull 10 records for each loop.
[color=rgb(127, 140, 141)][font=Roboto][img]att5[/img][/font][/color]Navigate to the Steps tab and navigate to Integration > Database > Your Database > The Exec step for the query you created. Attach this to the multiply step, and then to the end step. The screenshots below show exactly how this should look:
[color=rgb(127, 140, 141)][font=Roboto][img]att6[/img][/font][/color]
[color=rgb(127, 140, 141)][font=Roboto][img]att7[/img][/font][/color]This flow should help you reach the end goal youre looking to reach.
Howdy, Stranger!
Categories
- 4.2K All Categories
- 67 General
- 11 Training
- 202 Installation / Setup
- 1.1K Flows
- 106 Rules
- 262 Administration
- 212 Portal
- 490 General Q & A
- 695 Forms
- 333 Reports
- 3 Designer Extensions
- 47 Example Flows
- 52 CSS Examples
- 1 Diagram Tile
- 7 Javascript Controls
- 179 Pages
- 5 Process Mining
- New Features
- 179 Datastructures
- 69 Repository
- 221 Integrations
- 28 Multi-Tenant
- 27 SDK
- 78 Modules
- 56 Settings
- 25 Active Directory
- 12 Version 7
- 35 Version 8
- 83 Lunch And Learn Questions