Are REQUIRED components only classed as required if visible?

Hi

I’m looking for a way to restrict file uploads to pdf only.

I can’t restrict the file type upload directly but I thought I could prevent the submission of a new item if it wasn’t a pdf by doing this:

When adding a new item…

The file picker is the first item on the screen and the rest of the required components are only visible if the uploaded file is a pdf.

But even though the file type chosen is something different and there are required components that have not been selected you can still click the “Add” to submit the new item.

Is there a workaround?

Many thanks

Rich

If the user picks a file and finished uploading it while he/she is still in the form button, does it record the new link in the data? How are you extracting the extension, by a RIGHT formula?

Surprisingly, although not in the data as such, you can set the visibilty using if the file link ‘contains’ or ‘does not contain’ “.pdf” within the component features.

So that part works…

The best I can come up with so far, using the above technique, is having a warning text component become visible if the wrong file type is uploaded.

I’d still like to find a way to prevent submission if the file type is incorrect.

1 Like

It seems to be the case now that if a field is not shown, even if required, then you can submit the form. I am pretty sure that this was not the case not so long ago, but it seems to have changed.

I am also bummed by this as there seems to be no way, for instance, to prevent submission of a form, containing dates that should be in the future, if these dates are in the past. This is pretty annoying.

The workaround for this should be a fake form tab that stores inputs in multiple user-specific columns, then catch all of them via Columns component in the real form. Not ideal, but would work.

Not sure I fully get your workaround.

Does that imply that the user would need to submit the information twice?

Also, would this really prevent a wrong date to be entered? The column component would just catch the data, maybe invalidate it somehow after control, but that wouldn’t help the user enter a valid date I think.

With a user-specific column, you can validate the entry. Let’s say an If Then Else, if date entered is before today then Invalid, else Valid.

Show the form button only when Valid, else show a text warning about the Invalid entry.

In the form, the ideal way is to show them all the information they have entered and ask them to read through again before submit. Just a way to prevent a blank screen while collecting data via Columns.

I see, it could work indeed, thanks!

The fact remains that I am not a fan of the 2-step approach, but it seems it is now the only way to deal with data validation in forms.

1 Like

Thanks for the update!

Yeah no worries, I find this issue pretty annoying, so I was happy to find your message and post under the same thread :wink: