Export product list file file

Hi everybody
I’m creating an app to mail a bunch of lists.
But I don’t know how to output the product list when multiple products are selected.
When you select an additional product, the file automatically adds a row.

This photo shows the value of a product

And when I select multiple products, the table will arise according to the number of selected products

Please help me and thanks