Download the .oml or .oap file from the OutSystems Forge.
.oml
.oap
Open OutSystems Service Studio.
Import the component into your application or environment.
Publish the module to your environment.
No specific configuration is needed, but here’s what you can optionally customize:
Chunk Size: Set the desired number of items per chunk via an input parameter.
Input List: Provide a JSON array (wrapped or unwrapped) as input.
Output: The component will return a list of JSON strings (chunks) containing evenly divided data.
Add the Server Action SplitJsonArrayIntoChunks from the module in your logic flow.
SplitJsonArrayIntoChunks
Provide the following:
InputJson: A JSON string (e.g., [{"Id":1,"Name":"A"},{"Id":2,"Name":"B"}])
InputJson
[{"Id":1,"Name":"A"},{"Id":2,"Name":"B"}]
ChunkSize: Integer (e.g., 3)
ChunkSize
3
The output will be:
json[ "[{\"Id\":1,\"Name\":\"A\"},{\"Id\":2,\"Name\":\"B\"},{\"Id\":3,\"Name\":\"C\"}]", "[{\"Id\":4,\"Name\":\"D\"},{\"Id\":5,\"Name\":\"E\"}]" ]
Suppose you want to process large lists in batches via asynchronous processes or timers.
This component helps break the list into manageable sizes and stores them for parallel processing, improving performance and avoiding timeouts.
This Forge asset includes a fully working demo with:
Input box to set chunk size
Live result display
Progress indicator
Record summary
Example table with the processed data
You can customize the logic or UI as needed in your applications.