Hi @mahmouddahbour ,
Do you want to merge three lists to one list?
Does Stocks contain QuantityOFITEM field, Purchase orders contain QuantityOFITEMIN field, STOCKOUT contain QuantityOFITEMOUT field?
Could you tell me the data type of
1)ITEM_NAME, QuantityOFITEM in Stocks list?
2)Itemin, QuantityOFITEMIN in Purchase orders list?
3)Itemsout, QuantityOFITEMOUT in STOCKOUT list?
I assume that:
1)ITEM_NAME( text type), QuantityOFITEM(number type) in Stocks list.
2)Itemin( text type), QuantityOFITEMIN(number type) in Purchase orders list.
3)Itemsout( text type), QuantityOFITEMOUT(number type) in STOCKOUT list.
I suggest you build a collection with the merged data, set the screen's OnVisible:
ClearCollect(collection1,
AddColumns(Stocks,"QuantityOFITEMIN",0,"QuantityOFITEMOUT",0)
);
//create a collection with the data of stocks and add two columns with blank value
ForAll('Purchase orders',
Patch(collection1,
LookUp(collection1,ITEM_NAME=Itemin),
{QuantityOFITEMIN:'Purchase orders'[@QuantityOFITEMIN]}
)
);
//use 'Purchase orders' to update QuantityOFITEMIN value in collection1
ForAll(STOCKOUT,
Patch(collection1,
LookUp(collection1,ITEM_NAME=Itemsout),
{QuantityOFITEMOUT:STOCKOUT[@QuantityOFITEMOUT]}
)
);
//use STOCKOUT to update QuantityOFITEMOUT value in collection1
AddColumns(collection1, "QuantityOFITEMFinal",QuantityOFITEM + QuantityOFITEMIN- QuantityOFITEMOUT)
Firstly, use Stocks list to create a collection, then use the other two lists to update this collection. Then add a column by using the formula: QuantityOFITEMFinal (QuantityOFITEM + QuantityOFITEMIN- QuantityOFITEMOUT )
The collection1 will be the final table that you want.
You just need to set the gallery's Items to collection1.
Best regards,