
Announcements
Hi all,
I am trying to patch to all records where the name is "Ross" and the Week No. is that which the user has typed. I believe I need to use the "for all" function but I can't seem to make it work. Here is my working code which patches to a singular record but fails to patch to all records meeting the conditions:
If(
IsBlank(RossWeekInput.Text),
Notify("Please fill in a week number.", NotificationType.Error, 2000),
If(
IsBlank(
LookUp(
Times,
'Week No.' = Value(RossWeekInput.Text) && Name = "Ross"
)
),
Notify("Error. No records exist for that week.", NotificationType.Error, 2000),
Patch(
Times,
LookUp(
Times,
'Week No.' = Value(RossWeekInput.Text) && Name = "Ross"
),
{
'Pay Status': "PAID"
}
);
Notify("Record updated successfully.", NotificationType.Success, 2000)
)
);
Reset(Checkbox1)
Any help appreciated thanks!
Hi @R45 ,
This may be a better approach
If(
IsBlank(RossWeekInput.Text),
Notify(
"Please fill in a week number.",
NotificationType.Error,
2000
),
IsBlank(
LookUp(
Times,
'Week No.' = Value(RossWeekInput.Text) && Name = "Ross"
).Name
),
Notify(
"Error. No records exist for that week.",
NotificationType.Error,
2000
),
UpdateIf(
Times,
'Week No.' = Value(RossWeekInput.Text) && Name = "Ross",
{'Pay Status': "PAID"}
);
Notify(
"Record/s updated successfully.",
NotificationType.Success,
2000
)
);
Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.
MVP (Business Applications) Visit my blog Practical Power Apps