I have an app that records employee's goals to a SharePoint list ('Goals List'). The employees enter their goals via text input boxes and click a submit button. The button writes their goals to the list. If there are no errors, it then emails their manager to approve the goals. Something weird happened though with one employee out of 30, the email went out but no goals ever posted. I'm trying to determine possible scenarios where the patch would have failed to write to the list without generating an error, so that I can prevent this going forward. Does anyone know if its possible that the patch command would fail to write to the list but wouldn't generate an error?
Submit Button:
//Create a new record for this year's goals
Patch(
'Goals List',
Defaults('Goals List'),
{
Title:User().FullName,
'Employee''s Email':User().Email,
'Manager''s Name':Office365Users.ManagerV2(User().Email).displayName,
'Manager''s Email':Office365Users.ManagerV2(User().Email).mail,
'Goals - Submitted Date':Text(Now(),"mm/dd/yyyy hh:mm AM/PM"),
//Year:Year(Now()),
'Goal 1':GoalInput_1.Text,
'Goal 2':GoalInput_2.Text,
'Goal 3':GoalInput_3.Text,
Status: {Value: "Manager Review"}
}
)
;
//Notify user of errors when posting to list. If no errors, notify user of success.
If(
!IsEmpty(Errors('Goals List')),
Notify("Failed to record changes",NotificationType.Error,7000),
Notify("Record successfully updated. You will be receive a confirmation after your manager approves your goals.",NotificationType.Success,7000)
;
//Email manager using the EmailContainer_GoalsSubmitted container settings if no errors
Office365Outlook.SendEmailV2(EmailInput_Recipients_6.Text,EmailInput_Subject_6.Text,EmailRichText_Body_6.HtmlText)
)
Additional background: