Only one field in my Power App is causing problem when updating : the "person" field.
I have a collection that keeps track of the updates, and when an update is sent with a "save" button, the update collection is cleared.
If I add a "person" to an entry, and hit "save", the update collection does not get cleared.
Any idea ?
Here's what I use for person :
- combo box
- OnChange = Select(btnUpdate) - like my other fields
- Items = Choices(Tasks.Auteur) - like my "Priority" field, which is Choices(Tasks.Priority)
- DefautSelectedItems = ThisItem.Auteur
The btnUpdate OnSelect code :
If(
IsBlank(
LookUp(
colGridUpdates,
ID = ThisItem.ID
)
),
Collect(
colGridUpdates, // c ici qu'on crée la collection
ThisItem
)
);
UpdateIf(
colGridUpdates,
ID = ThisItem.ID,
{
Titre: txtTitle.Value,
Description: dpDescription.Value,
'Due Date': dpDueDate.SelectedDate,
Priority: {Value: dpPriority.Selected.Value},
Auteur: combobox_usagers.Selected
}
)
The "save" button OnSelect code :
Patch(
Tasks,
ShowColumns(
colGridUpdates,
"Title",
"Description",
"DyeDate",
"ProjectLookup",
"Priority",
"Auteur",
"ID"
)
);
Select(btnLoadGrid);
Notify("Tâche sauvegardée", NotificationType.Success, 3000)
The btnLoadGrid OnSelect code :
ClearCollect(
colGridData,
Filter(
Tasks,
'Project Lookup'.Value = RecordsGallery1.Selected.Titre
)
);
Clear(colGridUpdates);
Set(varReset, false); Set(varReset, true);