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
Your constant needs to look like this:
It does look like that
Can you show a screenshot?
I think there could be a problem during the creation of a constant.
To create a constant with multiple values (array), follow these steps:
Did you check that there are no trailing spaces for each of your values?
Just checked
There was 1 trailing space for PNG
Thanks
There was a trailing space