Hello,
Simply put I cannot workout how to patch a modern control checkbox to a collection (patching to dataverse works fine).
Some background:
I am creating a canvas app (in the Teams interface) built on Dataverse for Teams. I have a simple table (follow) with three columns:
kit (text type) | item (text type)| checked (Yes/No type)
In my app I collect the table in the onStart, ClearCollect(follow, localFollow) , the checked (Yes/No type column) is populated with a question mark, internally it has ID:true/false and Value:Yes/No
In a gallery each item has a modern control checkbox:
Checked = LookUp(CheckboxStates, item = ThisItem.item && kit = drpKit.Selected.Value).checked
When a user checks an unchecked checkbox it patches to the follow table
Patch(
follow,
If(
IsBlank(LookUp(follow, kit = drpKit.Selected.Value && coussin = ThisItem.item)),
Defaults(follow),
LookUp(follow, kit = drpKit.Selected.Value && coussin = ThisItem.item)
),
{
kit: drpKit.Selected.Value,
coussin: ThisItem.item,
checked: true
}
)
Everything works fine just to there but I am completely stuck on how to patch the collection:
{
kit: drpKit.Selected.Value,
item: ThisItem.item,
checked: true <---------- THIS IS THE PROBLEM
}
In place of checked: true I have tried:
checked: {ID: true}
checked: {Value: "Yes"}
checked: Checkbox.Checked
checked: If(Checkbox.checked = true, true, false)
I have tried using the display name of the field and the schema name - but nothing validates - copilot has me going in circles - can anyone help ?
P.S
The only way I have got the patch to work is like this (looking up the checked status in the dataverse table after the table patch - which is not a good solution)
{
kit: drpKit.Selected.Value,
item: ThisItem.item,
checked: LookUp(follow, kit = drpKit.Selected.Value && item = ThisItem.item).checked
}