Every time field is updating its value

You need to add some condition in the logic hook that can tell the difference between the two cases (inline edit vs. record creation)

Have a look at the fetched_row value, see examples of usage here: