I'm trying to patch a certain data into my Sharepoint list to update the data that's inside the table. It's a leave app that's currently lacking the ability to update it's Sharepoint List. This is the requirements that I need to meet, I need to update the Used data field by the Duration that the user has selected. Above that, I need to match the type of leave that they have chosen, whether if it is Medical, Maternity or Annual (Anything besides Medical/Maternity will be added to the annual Used column). Is there a possibility where I match the user's name as well? The following is the current code:
If(
DataCardValue15.Selected.Value= "Medical",
Patch(
'EMP Leave Quota',
{Title:Text(Self.LastSubmit.'Employee No')},
{Used:0}
),
DataCardValue15.Selected.Value= "Maternity",
Patch(
'EMP Leave Quota',
{Title:Text(Self.LastSubmit.'Employee No')},
{Used:Value(DataCardValue24.Text)}
),
Patch(
'EMP Leave Quota',
{Title:Text(Self.LastSubmit.'Employee No')},
{Used:Value(DataCardValue24.Text)}
)
);
DataCardValue15 is the selection box and DataCardValue24 is the Duration column in the app.