// Check if all forms are valid
If(
Form1_1.Valid && Form2.Valid && Form1.Valid,
// Patch the data to the SharePoint list
With(
{
result: Patch(
'Journey Management Plan Risk Assesment',
Defaults('Journey Management Plan Risk Assesment'),
// Manually setting fields like Employee and Manager
{
Employee: {
Claims: "i:0#.f|membership|" & Lower(LookUp(ComboBox1.SelectedItems,1=1).Mail),
DisplayName: LookUp(ComboBox1.SelectedItems,1=1).DisplayName,
Email: LookUp(ComboBox1.SelectedItems,1=1).Mail,
Department: LookUp(ComboBox1.SelectedItems,1=1).Department,
JobTitle: LookUp(ComboBox1.SelectedItems,1=1).JobTitle,
Picture: "" // If you have a picture URL or field, include it here
},
ManagerName: {
Claims: "i:0#.f|membership|" & Lower(Office365Users.ManagerV2(ComboBox1.Selected.Id).mail),
DisplayName: Office365Users.ManagerV2(ComboBox1.Selected.Id).displayName,
Email: Office365Users.ManagerV2(ComboBox1.Selected.Id).mail,
Department: "", // If Manager's department is available, include it
JobTitle: "", // If Manager's job title is available, include it
Picture: "" // If Manager's picture URL or field is available, include it
}
},
// Apply all form updates from Form1_1, Form2, Form1, and Form3
Form1_1.Updates,
Form2.Updates,
Form1.Updates,
Form3.Updates
)
},
// Check if the patch was successful
If(
IsError(result), // Check for errors instead of IsEmpty
Notify("Error submitting forms", NotificationType.Error),
// Navigate to Screen6 if successful
Navigate(Screen6, ScreenTransition.Fade)
)
)
);