Contains() function Not Giving Results

Certified Senior Developer

Hi 

I have created a constant for storing all the valid file extensions 

constant : OPP_TXT_VALID_FILE_EXTENSION  -> {"PDF", "JPEG", "JPG", "PNG", "DOCX", "DOC", "XLSX", "XLS", "CSV", "TXT"

Now I wanted to implement a validation in fileUploadField wherein I want to check for valid file extensions. For this I am using the contains function 

contains (
  cons!OPP_TXT_VALID_FILE_EXTENSIONS,
  upper(fv!files.extension)
)

Now even for a valid file extension (say PNG) this validation fails

But if I use normal array of hardcoded values instead of constant then I am getting the desired result

contains(
  {"PDF", "JPEG", "JPG", "PNG", "DOCX", "DOC", "XLSX", "XLS", "CSV", "TXT"},
  upper(fv!files.extension)
)
   

Is there something that I am missing ?

  Discussion posts and replies are publicly visible