Limit Result Rows
Simple Query against Products Master Data Table.
Limit the maximum number of rows returned using
.take()method.If there is no sort method included rows are selected randomly.
Code
def qapi = api.queryApi()
def p = qapi.tables().products()
return qapi.source(p, [p.sku(), p.label])
.take(10)
.stream { it.collect { it } }Result
sku | label |
|---|---|
G03AQ6_5 | 3G Squat Round |
128JS2 | Hot Fill Juice 128 oz |
Dairy | Dairy |
FEED003 | High-pile Feeder, semi-automatic Feeder for Offset Printing Press 70x100 |
FEED004 | High-pile Feeder, fully automatic Feeder for Offset Printing Press 70x100 |
FILTERSET | Fiter Set |
IDR0001 | IDR Bundle 35x50 (Ink and Dampening Roller) |
IDR0002 | IDR Bundle 70x100 (Ink and Dampening Roller) |
INK0001 | Ink - Cyan 2kg |
INK0002 | Ink - Magenta 2kg |
See Also
Found an issue in documentation? Write to us.