HI everyone. I'm trying to capture some details of first time users, I'm using the following code:
// Store details for First Time User
If(
IsBlank(LookUp(AppUsers,'User Email' = User().Email).'User Email'),
Patch(AppUsers, Defaults(AppUsers), {'User Name': User().FullName, 'User Email': User().Email, Office365ID:User().EntraObjectId})
);
If(
IsBlank(LookUp('Leave Allowances', 'User Email' = User().Email).'User Email'),
Patch('Leave Allowances', Defaults('Leave Allowances'), {'User Email': User().Email, Office365ID: User().EntraObjectId}),
Patch(LookUp('Leave Allowances', 'User Email' = User().Email), {'User Email': User().Email, Office365ID: User().EntraObjectId})
);
The AppUsers table gets updated fine, no problem there. The Leave Allowances table doesn't update the way I would like it, it adds user email and ID to a new record rather than updating an existing record. Any help as to why this is?
Thanks