Add or Modify Row: Add row if no match found

Hi Codans!
I’ve added a “log” table where I want to store data. To prevent duplicates, I’d love it if the log would just modify a row if it finds a match (a unique number). If there’s no match, then create a new row.

Is this possible?

Yes — the AddOrModifyRows() function is just for that :slightly_smiling_face:

Although I still prefer to use

If(
  Table.Filter(...).Count() = 0,
  Table.AddRow(...),
  _Noop()
)

as it supports cases when e.g. no modification is needed, and is overall more flexible (and IIRC proved to be more reliable)

2 Likes