Hi,
Variable can be global and local.
You create the variable when acquiring the data record I assume you're clicking a button or an icon inside the gallery to select the record you want to view, you can add
Set(varChecklist, ThisItem.checklist_column);
then in the fist checkbox default you put:
If(!IsBlank(varChecklist), If(Index(ForAll(Split(varChecklist, ","), {Result: ThisRecord.Value}), 1).Result = "true", true ,false))
second:
If(!IsBlank(varChecklist), If(Index(ForAll(Split(varChecklist, ","), {Result: ThisRecord.Value}), 2).Result = "true", true ,false))
and so on.
to save the values of the checkboxes whatever action button or icon you're using to save your edits OnSelect property put:
Patch(
splist_name,
Coalesce(
LookUp(
splist_name, yourRecordId = selectedRecord.yourRecordId
),
Defaults(splist_name)
),
{checklist_column: checkbox1.Value & "," & checkbox2.Value & "," & checkbox3.Value & "," & checkbox4.Value & ",",
}
)
splist_name - name of your sharepoint list
yourRecordId - a value in the column that you will locate the record with (can be system created "ID" column
slectedRecord - you need to point to the record you selected (i usually do Set(varSelectedItem, ThisItem) in OnSelect of the gallery)
checkllist_column - text column in which you will store your string with checkbox values
checkbox1/2/3/4 - names of your checkbox controls.
I don't use forms but i assume that if you add the patch above into the same action and keep the form.updates they will clash so you'd have to remove the checkboxes from the form and just chuck them in the root of the screen above the form or container or something.
you may have errors when you delete them from the cards because forms elements depend on each other for positioning as far as i remember but most you can just delete.
If i was in your position i would sump the forms and just use patch and place the controls yourself, total freedom and control over the design of your apps.
Anyways, if you need any more clarification or help give me a shout 🙂
good luck!
Seb