Okay this might not be the final solution as i am making some assumptions but I am just updating the solution options as I gather more information:
Option One
ForAll(
cbIdea.SelectedItems,
Collect(
colideatopatchproduct,
{
Id: ThisRecord.ID,
Value: ThisRecord.Subject
}
)
);
ForAll(
cbproduct.SelectedItems As cbprodselected,
Collect(
colProducttopatch,
{
Id: cbprodselected.ProductID,
Value: cbprodselected.Name
}
);
Patch(
Junction_Table_Idea_Products,
Defaults(Junction_Table_Idea_Products),
{
Name: "Test",
Product_L: cbprodselected
}
)
);
​
Option 2
ForAll(
cbIdea.SelectedItems,
Collect(
colideatopatchproduct,
{
Id: ThisRecord.ID,
Value: ThisRecord.Subject
}
)
);
ForAll(
cbproduct.SelectedItems As cbprodselected,
Collect(
colProducttopatch,
{
Id: cbprodselected.ProductID,
Value: cbprodselected.Name
}
);
Patch(
Junction_Table_Idea_Products,
Defaults(Junction_Table_Idea_Products),
{
Name: "Test",
Product_L: LookUp(Products,ProductID= cbprodselected.ProductID)
}
)
);
If neither of these work it is likely either due to the names of the columns or the fact that I made an assumption that ProductID is the GUID for a record in the Products table which has been selected.
Also I am assuming that the reason we ForAll through colProducttopatch is just to patch the selecteditems that we have collected for some other purpose but if it is to patch from other sources in the app aswell it would need to look more like:
Option 3
ForAll(
cbIdea.SelectedItems,
Collect(
colideatopatchproduct,
{
Id: ThisRecord.ID,
Value: ThisRecord.Subject
}
)
);
ForAll(
cbproduct.SelectedItems As cbprodselected,
Collect(
colProducttopatch,
{
Id: cbprodselected.ProductID,
Value: cbprodselected.Name
}
)
);
ForAll(
colProducttopatch As prodstopatch
Patch(
Junction_Table_Idea_Products,
Defaults(Junction_Table_Idea_Products),
{
Name: "Test",
Product_L: LookUp(Products,ProductID= prodstopatch.Id)
}
)
);
if none of these scenarios are your one I would like a screenshot of the column names from the products table and from the juction table. I have ordered the options in most likely to be your scenario