Hi everyone,
I'm building a Power Apps application connected to a SharePoint list called 'Boitiers KPAX'.
I have a form with a dropdown control (DataCardValue3) that can take two values: "PRIS" or "INSTALLE".
I want to trigger an automatic Patch to the SharePoint list in the OnChange event of the dropdown, depending on the selected value:
• If "PRIS" → write to columns TECH (Person) and RECUPERE (Date/time)
• If "INSTALLE" → write to columns TECH (Person) and INSTALLATION (Date/time)
In both cases, TECH should contain the currently logged-in user (User().Email / User().FullName) and the date/time should be the current moment (Now()).
Technical details:
- The TECH column is a Person type (single person only)
- My Power Apps environment uses French locale (separator: ;)
- I'm using '@odata.type' with #Microsoft.Azure.Connectors.SharePoint.SPListExpandedUser for the Person column
Here is the code I'm currently using:
If(
DataCardValue3.Selected.Value = "PRIS";
Patch(
'Boitiers KPAX';
ThisItem;
{
TECH: {
'@odata.type': "#Microsoft.Azure.Connectors.SharePoint.SPListExpandedUser";
Claims: "i:0#.f|membership|" & User().Email;
DisplayName: User().FullName;
Email: User().Email;
JobTitle: "";
Picture: ""
};
RECUPERE: Now()
}
);
DataCardValue3.Selected.Value = "INSTALLE";
Patch(
'Boitiers KPAX';
ThisItem;
{
TECH: {
'@odata.type': "#Microsoft.Azure.Connectors.SharePoint.SPListExpandedUser";
Claims: "i:0#.f|membership|" & User().Email;
DisplayName: User().FullName;
Email: User().Email;
JobTitle: "";
Picture: ""
};
INSTALLATION: Now()
}
)
)
Has anyone implemented this kind of logic before? Does the code look correct to you? Any feedback is welcome, thanks in advance!