Prevent duplicate registration

Hi

In the form below, the user can register an activity.

How could I prevent another user from making an exactly the same release?

image

I think you can add a ID or something like that

1 Like

https://community.appsheet.com/search?q=%23ask%20prevent%20duplicate

3 Likes

Hi

thanks for the help, sorry for the beginner question, but I’m learning…

I tried to adapt a tip from @Steve , but I’m in doubt about its application.

I have a table with columns [CONSULTANTS],[ACTIVITY],[START DATE],[END DATE],
[TURN]

when the user is going to save a new record, the formula must verify that there are no identical data in the table.

if it exists, generate an error with the message “this record could not be saved”

and where should i add this expression?

ISBLANK(
FILTER(
“table”,
AND(
([column1] = [_THISROW].[column1]),
([column2] = [_THISROW].[column2]),
…,
([columnN] = [_THISROW].[columnN])
)
)
)

1 Like

Hi

I inserted this expression in the columns and when I try to duplicate a record the form hides.

So far it seems to be a great solution, because it prevents the user from proceeding with a duplicity.

But the form’s SAVE button is available.

How can I solve this?
Can I condition the button to be invisible in this case?

ISBLANK(
  FILTER(
    "RESERVS",
    AND(
      ISNOTBLANK([CONSULTANTS]),
      ([CONSULTANTS] = [_THISROW].[CONSULTANTS]),
      ISNOTBLANK([ACTIVITY]),
      ([ACTIVITY] = [_THISROW].[ACTIVITY]),
      ISNOTBLANK([START DATE]),
      ([START DATE] = [_THISROW].[START DATE]),
      ISNOTBLANK([END DATE]),
      ([END DATE] = [_THISROW].[END DATE]),
      ISNOTBLANK([TURN]),
      ([TURN] = [_THISROW].[TURN]),
      NOT([_ROWNUMBER] = [_THISROW].[_ROWNUMBER])
    )
  )
)

Where?

What does “the form hides” mean?

You can from UX>Localize, but I wouldn’t recommend that in this case. Use validation instead.

2 Likes

I entered the expression in each column that I need to validate.

image

When the form is being filled out, it looks like this

image

And during filling, when you select the turn, if the values entered in the form are on the table, the form looks like this

image

I don’t know if this is the best way to avoid duplication, but it works well for me. But in this case, the save button could be disabled and the user would get an error message.

If there is a best practice to avoid duplication, I am open to suggestions

You put your expression in show_if instead of valid_if.

2 Likes

Solved

One more lesson learned

@Marc_Dillon Thank you very much!

Thank you community

1 Like