Server action condition if no file uploaded in the app form

Hi,

I am not sure why this is not working.
I am trying to skip the upload file and an insert to the DB when and if there is no file has been uploaded in a simple file upload form.
I tried $_POST.pck_image!=’’ but it won’t let me enter the “’’”. I tried length count and it still didn’t work.
Any ideas?

Try this expression in the condition with single quotes and brackets.

($_POST.pck_image!='')

1 Like

Thanks @guptast the trick were the brackets in order to keep the “’’”

1 Like

Your expression should just be:

{{$_POST.pck_image}}

This will return false when no value is submitted with the input.

This created an error. This is server side app

Well … just pick the input from the picker. It will generate the correct expression for you. {{ and }} should not be used in the code view of the picker. Just expand $_POST and click your input there, that’s the purpose of the data picker.

I understand @Teodor this is the reason why I posted this, it does not work when I simply select the Post value from data picker.

But your condition is still:

Screenshot 2023-11-19 at 10.43.39

That worked. Not sure why it didn’t work the first time I tried it.
Thank you…

I see another issue - your input has not been properly set as a file input:

Set it to type File and then you can directly check if it contains a file name:

1 Like