Help Needed with VALID_IF Expression Parsing Error

I'm experiencing difficulties with a VALID_IF expression. The goal is to validate barcode scans based on their length and format, however, I'm encountering persistent parsing errors, specifically with matching the number of opened and closed parentheses. Despite balancing the parentheses, I keep receiving a parsing error.

Here's the expression I've been attempting to use:

AND(
          OR(
                  LEN([VIN SCAN]) = 17,
                  AND(
                             LEN([VIN SCAN]) = 8,
                             FIND(UPPER([VIN SCAN]), [VIN SCAN]) > 0
                  )
           ),
          NOT(CONTAINS([VIN SCAN], "\"vin\":\""))
)

I would greatly appreciate any insights or suggestions on how to resolve this error, or alternative approaches to achieve the same validation.

Solved Solved
1 4 129
1 ACCEPTED SOLUTION

@Lindsey_Lindow wrote:

  NOT(CONTAINS([VIN SCAN], "\"vin\":\""))


It sounds that the number of double quotes in the above sub expression , specifically within the part "\"vin\":\"" are not correct and could be source of error. There seem to be uneven number, that is, 5 double quotes within that part. You may want to elaborate what string you are trying to test within that CONTAINS() function inside [VIN SCAN} column and the community could suggest.

Just to immediately test and confirm that it is the error source, you could substitute  "\"vin\":\"" with any other string such as  NOT(CONTAINS([VIN SCAN], "Test")) and check if the expression parses.

View solution in original post

4 REPLIES 4

I'm a noob and self-taught so my advice isn't typically the best lol, but i would give this a try: 

AND(
OR(
LEN([VIN SCAN]) = 17,
AND(
LEN([VIN SCAN]) = 8,
UPPER([VIN SCAN]) = [VIN SCAN]
)
),
NOT(CONTAINS([VIN SCAN], "\"vin\":\""))
)

 

@Lindsey_Lindow wrote:

  NOT(CONTAINS([VIN SCAN], "\"vin\":\""))


It sounds that the number of double quotes in the above sub expression , specifically within the part "\"vin\":\"" are not correct and could be source of error. There seem to be uneven number, that is, 5 double quotes within that part. You may want to elaborate what string you are trying to test within that CONTAINS() function inside [VIN SCAN} column and the community could suggest.

Just to immediately test and confirm that it is the error source, you could substitute  "\"vin\":\"" with any other string such as  NOT(CONTAINS([VIN SCAN], "Test")) and check if the expression parses.

You are right, that was the issue. Thank you for spotting that!

You are welcome.

Top Labels in this Space