Only allow specific file types using validation rules

Am I missing something?

[Step 1 Source Document].Files.Filter(
  Find([Content Type], "pdf") < 0 and
    StartsWith([Content Type], "image/") = false
).Count() = 0

This is always blocking any new submission.

It seems like validation rules do not work for images on create. I suspect it is because they are attached after the entity is created? Not sure.

Changing this to a bug, if others have an idea, do let me know!

It’s a bug, thanks for reporting.

We will fix it. Will inform here when fixed.

By the way how do you create entity with the file? Automations, Forms, somewhere else?

Thank you!!

Forms. Internal form view + form popup. Didn’t try elsewhere.

Hey! Is there any update on this one? Thank you!

I want to implement file compressing, but the compressor can only handle certain file types…

No. We haven’t heard a lot of complaints, so it’s not high-priority I’m afraid

Okay thanks for letting me know! I’ll figure out a different solution in the mean time then

Hm.

I’ve checked and when creating entity via forms, Files seem to be attached as a part of Entity creation.

So I’ve added a simple Validation Rule. And it alerts when I create entity via form without Files. And works ok when I create entity via form and add upload some files.

So can you please describe in more details what does not work for you :folded_hands:

Hmmmm!
It seems to indeed be working now! Here’s the formula I used:

[Step 1 Project].Files.Filter(
  Find([Content Type], "pdf") = 0 and
    Find([Content Type], "image") = 0
).Count() > 0

Not sure what changed, thought I tested simple formulas like yours and it didnt work… Guess my original formula was just wrong.

Thanks!