I have a query wich returns forms sended by the user.
From each form I make a condition and if it’s true, then insert a “9”.
The api works great, but I recently added a validator to avoid duplicates and I don’t know why it’s not working.
I can’t see anything amiss straight off the bat so just going through what I would look at…
Are you getting the error message on your form?
If so, try changing the message to make sure that’s where the action is happening.
If you’re not getting the message, or the message doesn’t change then make sure you don’t have an insert step elsewhere in your server action that’s doing the insert.
I am not able to follow the steps you are doing and of course I cannot investigate your code or suggest a solution myself…
But for sure I would have start by searching very deep and carefully the validation step since this is the extra step that creates the problem…
(I can’t even imagine what the validation checks for because of the language).
I’m sorry but I think if you start seeing your validation with clear mind, you will figure it out probably
Thanks @famousmag kindly as always.
The truth it’s I’m showing that I have a repeat of a form wich retrieves others forms with the respective ID (in this case we see the problem is on the ID 51 but it happens in all the ID’s)
The ammount of conditions of course may be confusing, but the thing results as:
Condition - Then - Insert
The insert is happening, but why not the previous validate step?
It’s just right before the insert step.
The validate takes “Already exist 51” and then it’ll insert anyway.
The only workaround I found was making a query and a condition if has value (like the validate will do):
Then -
Else - Insert
So my guess it’s the validate wich is not working properly.