Hi, I need help with something that seems simple to me but I don’t know how to do it, in this doc I have 3 tables; Products, GenerateOrder, and Order. I would like to go to GenerateOrder, put the order number and customer information and that all the rows of the product table that have that customer with the order ide will be copied to the Order table. I can’t send the order id along with the rows and the best I’ve achieved is that everything is created within the same cell instead of one row per product with its order id. I would greatly appreciate your help.
https://coda.io/d/TEST_dfwUsIkYL3Q/TEST_suRdH#_lu3Zr
Hi @exeinformatica_microsshop !
I’m not entirely sure but is this what you were trying to accomplish ?
(See the blue button in the field [Generate 2]
)
The Action
formula within the button is this one :
Products.Filter(Client.Contains(thisRow.Client)).ForEach(
CurrentValue.WithName(Product,
AddRow(
Order,
Order.[Order id],
thisRow.[Order Id],
Order.Product,
Product.Name,
Order.Client,
Product.Client
)
)
)
The 1st step is to create the list of rows from your table Products
where CurrentValue.Client
contains thisRow.Client
(You could also use ContainsText()
instead of Contains()
, depending on your actual doc setup ).
Then each row in the list coming from the Products
table is stored within the value Product
using WithName() and for each Product
, I ask the button to add a row in the table Order
where:
-
Order.[Order id]
gets the value inthisRow.[Order Id]
-
Order.Product
gets the value in the fieldName
for this currentProduct
(asProduct
stores a row from the tableProducts
) -
Order.Client
gets the value in the fieldClient
for this currentProduct
I hope this helps !
(If I was going into the right direction with this )
It is perfect. thanks a lot. I was stuck and didn’t know how to do it. It’s great to have received such good help and so soon.
My pleasure @exeinformatica_microsshop !
I’m very glad to know this works as expected and helped you moving forward !
This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.