Valid if conditions not work proper

I want to lock some specific symbols and prevent duplicate values ​​from being entered. Please tell me what is wrong with this. 

 

AND(ISNOTBLANK(

  FILTER(

    "Sale table",

    ([_THISROW].[_ROWNUMBER] = [_ROWNUMBER])

  )

),

 

Not(

  OR(

    CONTAINS([_This], "CRP"),

    CONTAINS([_This], "~"),

    CONTAINS([_This], "`"),

    CONTAINS([_This], "!"),

    CONTAINS([_This], "@"),

    CONTAINS([_This], "#")

    CONTAINS([_This], "£"),

    CONTAINS([_This], "€"),

    CONTAINS([_This], "$"),

    CONTAINS([_This], "¥"),

    CONTAINS([_This], "%"),

    CONTAINS([_This], "&")

  )))

0 2 111
2 REPLIES 2

First, if you are intending to prevent duplicates, using [_ROWNUMBER] will not achieve that goal.  Row Numbers are automatically assigned by AppSheet and will not be duplicated.

Second, when NEW rows are being inserted, they will not yet be in the datasource.  So, attempting to FILTER in this use case will return zero rows and thus the ISNOTBLANK(FILTER()) will ALWAYS be FALSE for NEW rows.

The CONTAINS portion of your expression looks good to me.

_____________________________________________________________

If you wish to prevent "duplicates", you will need to identify what data in the row makes it a duplicate.  This could be one or more columns.  You will then need to validate that the data entry for those columns together on [_THISROW] are not already a combination that exists in the datasource.  

if there are multiple columns that make a row unique, the best way to perform the validation is to:

1)  Make those columns entry required.

2)  Force the user to enter them in order, i.e. only present a field if the one preceding it was entered.

3)  Then perform the validation on the last field, checking that row already exists with the same combination of data entry of the "unique" columns.

 

I really don't understand why do you keep publishing duplicate posts and ask the same question several times in separare posts? Several community members have asked you politely to stop doing this. 

@graham_howe already gave you the answer and told you what is wrong with your expression.

When the answer a community member has given you is not clear to you, or in case you have any problem implementing it or with its result, then you should reply to the person who spent time to study and answer your question to help you.

Instead you keep just ignoring conversations and posting the same questions elsewhere. Abandoning conversation is disrespectful and wasteful to other people's time, trying to answer you while having no clue what you are talking about. 

Please, again, be respectful and mindful to the advice you have been given repeatedly; you'll be helping others to help you and at the end you'll be the winner. 

Top Labels in this Space