Linking multiple Table Records together with one Button click

I´m currently dealing with the problem of linking multiple (table-) records together in one Button click.

First I have a step were a ProductionOrder is created.
(table data is only an example, project is not for a customer!)

Once I click a ProductionOrder (in the table) and “ADD MATERIAL” the step Create Material appears.

What I want, is to click create Material, while linking the ProductionOrder-ID and Product-ID from the ProductionOrder (that I have previously chosen).
Right know, I have to selct these from 2 tables and bind the ID´s of each table to the created Material (ProductionOrder-ID, Product-ID).
Saving the Product-ID from ProductionOrder-Table in a text variable did not work (Tulip only suggests text array variables).

What could I do ?

Thanks for your help in advance.