This is still a issue here.
If you have a button with a If or Switch code on it, this will cause issues and patch will not always work, it does not fail, but it actually wont patch anything.
I can add that if you use containers where you have the input field in one container and a submit button in another container, you will expireince more issues also.
When Focus Out is selected it works most of the time, but many times i will his submit, it will act like a patch have been successful, and close the ticket, but it will actually not patch the change and leave the text in the TextInputTicket.Value.
This have been working perfectly before, until i re-saved the app and the introduction of the Trigger Output was applied.
// Define user details and timestamp once
Set(
currentUser,
{
'@odata.type': "#Microsoft.Azure.Connectors.SharePoint.SPListExpandedUser",
Department: "",
DisplayName: User().FullName,
Claims: "i:0#.f|membership|" & Lower(User().Email),
Email: User().Email,
JobTitle: "",
Picture: ""
}
);
Set(
timestamp,
"<b>" & Char(10) & User().FullName & "</b>" & "<br> <span style='font-size:10.5pt'>" & Text(Now(), "[$-en-US]yyyy/mm/dd hh:mm") & "</span> <br> "
);
// Handle Patch Operations
If(
!IsBlank(TextInputTicket.Value),
Switch(
TabListMenu.Selected.Value,
"Message",
Patch(
Helpdesk,
CurrentItem,
{
'Case Comments': timestamp & TextInputTicket.Value & CurrentItem.'Case Comments',
LastComment: TextInputTicket.Value,
'Last Modified By': currentUser,
'Last Comment Made By': currentUser
}
),
"Worklog",
Patch(
Helpdesk,
CurrentItem,
{
Worklog: timestamp & TextInputTicket.Value & CurrentItem.Worklog,
'Last Modified By': currentUser
}
),
"Close",
Patch(
Helpdesk,
CurrentItem,
{
Resolution: timestamp & TextInputTicket.Value & CurrentItem.Resolution,
'Last Modified By': currentUser,
Status: {
'@odata.type': "#Microsoft.Azure.Connectors.SharePoint.SPListExpandedReference",
Id: 4,
Value: "Closed"
},
'Assigned To': currentUser
}
)
);
// Handle Errors and Reset
If(
!IsEmpty(Errors(Helpdesk)),
Notify(First(Errors(Helpdesk)).Message, NotificationType.Error),
UpdateContext({ CurrentItem: LookUp(Helpdesk, ID = CurrentItem.ID) });
Reset(TextInputTicket)
)
);
// Handle Ticket Filtering based on Tab Selection
If(
TabListMenu.Selected.Value = "Close",
Switch(
TabList1.Selected.Value,
"Unassigned",
ClearCollect(TicketsCollection, Filter(Helpdesk, Status.Value = "Unassigned")),
"My Tickets",
ClearCollect(
TicketsCollection,
Filter(
Helpdesk,
('Assigned To'.DisplayName = User().FullName) && (Status.Value in ["Assigned", "In Progress", "Waiting for user response", "Waiting for external resource", "Backlog"])
)
),
"Closed",
ClearCollect(
TicketsCollection,
Filter(
Sort(Helpdesk, ID, SortOrder.Descending),
'Assigned To'.DisplayName = User().FullName && Status.Value = "Closed"
)
);
Notify("Ticket was closed and placed under Closed tickets.", NotificationType.Success, 600),
"All",
ClearCollect(TicketsCollection, SortByColumns(Helpdesk, "CreatedDate", SortOrder.Descending))
);
UpdateContext({ itemSelected: false })
)