Patch updates a record in place when you give it an existing record, and it returns the updated record back, so you can check the new value straight off the Patch call itself instead of looking it up again.
Notify syntax is Notify(Message, NotificationType, Timeout), NotificationType.Error works for this kind of warning.
Putting those together, this reads the current value, adds 4, patches it, then checks the result of that same patch:
With(
{ _current: LookUp(YourSharePointList, ID = ThisItem.ID) },
With(
{
_updated: Patch(
YourSharePointList,
_current,
{ numCheckListObjectValue: _current.numCheckListObjectValue + 4 }
)
},
If(
_updated.numCheckListObjectValue = 16,
Notify("Maximum Value has been reached!!", NotificationType.Error)
)
)
)
Using With twice avoids hitting the list a second time just to check the value, the outer With grabs the current record once, the inner With captures Patch's own return value and checks that directly.
Best regards,
Valantis ✅ If this helped solve your issue, please Accept as Solution so others can find it quickly.
❤️ If it didn’t fully solve it but was still useful, please click “Yes” on “Was this reply helpful?” or leave a Like :).
🏷️ For follow-ups @Valantis.
📝 https://valantisond365.com/ 💼 LinkedIn ▶️ YouTube