I am trying to prevent duplicates from the entered text fields, but now it does not add any new data from the field, it also removes it.
I am also using this on submit action. I want to delete the action row there.
Sample
Action I am using
I am trying to prevent duplicates from the entered text fields, but now it does not add any new data from the field, it also removes it.
I am also using this on submit action. I want to delete the action row there.
Sample
Action I am using
It’s not good practice to add a row and immediately delete it afterwards. It’s most likely adding a row, then your On submit is possibly comparing Product Code to itself, so it will always match and take the Delete path. Also, your Else is essentially adding an Add Row action to a form that already adds a row, so if it did work, you would end up with duplicate rows each time you submit. When using a native form, don’t ever use an Add Row action On Submit, unless you want to add a row to the form table as well as add a row to a different table. In most cases, it’s not necessary and redundant.
I would create a Custom Form for this use case. Then you can check for a duplicate while filling out the form and hide or show the submit button as needed.
Do you have a step by step instructions on how to do this?
I don’t have anything written down, and it probably varies depending on the use case. What are you trying to do?
If you look at @Darren_Murphy’s post, that I linked to above, he has a sample app you can copy, which uses a custom form. Basically it’s a detail screen where you have components that fill user specific columns. in a table. Once you have those values filled, you can have a button with an Add Row action that will take those users specific values and write them to any table you want.
If you are asking specifically about checking for duplicates, then you can add relations in the table that has the user specific columns. That relation would take the value you entered and link it to the table that has all of your submitted form rows. If there is a match, then you have a duplicate. In that case you could set visibility on your submit button to only show when the relation is empty. If it’s not empty, then you could show a hint saying that there is a duplicate.
Thank you Jeff, this is helpful! I was actually referring to preventing duplicate entry which you have explained in detailed for me.
Thanks!