Duplicating records within generated pdf

I have an inventory management app where inventory is input in batches. Each batch contains various items and the quantities of each respective item.

I am currently able to generate a PDF document of a price tag for each item within a batch, but I would like to specifically generate a PDF document that contains a price tag for each item, and is duplicated within the document based on the quantity.

ie. If a Batch contains
Apples = 3
Oranges = 1
Grapes = 2

Currently the Batchโ€™s pdf shows -
Apples
Oranges
Grapes

I would like it to be -
Apples
Apples
Apples
Oranges
Grapes
Grapes

Any help would be appreciated!

0 2 87
2 REPLIES 2

Aurelien
Google Developer Expert
Google Developer Expert

Hi @Daly_Finds

I donโ€™t think itโ€™s possible, as the generated pdf is a โ€œpictureโ€ of what is currently in the tables.
Or, you will need to use a huge combination of If statement in your template, looking like:

<<If:[Quantity]=1>>yourText1<<End>>
<<If:[Quantity]=2>>yourText2<End>>
<<If:[Quantity]=3>>yourText3<End>>

Steve
Platinum 4
Platinum 4

Thereโ€™s really no good way to do what you want.

Top Labels in this Space