Forum Discussion

ArshadKhwaja's avatar
ArshadKhwaja
Qrew Commander
8 years ago

Testing for a file attachment

I am using check box to trigger a notification and I have linked this check box to the test if the file has been attached.  I used  "" as the value to test if the attachment is available.  But it does not quite work.  So the question is if there is indeed an attachment, what does that constitute in terms of testing the field? 

11 Replies

  • You should be able to use

    ToText([My file attachment field]) =""

    As a Boolean checkbox to be true if no file is attached.

    Or

    ToText([My file attachment field]) <> ""

    As the opposite test
  • Thanks Mark.  I was originally trying to use form rule but after looking at your formula, I decided to create a fiormula check box field and the code as under:  

    If(ToText([Drawing]) <>"", True, False)

    Looks like it is working in this shape but there is no way I could use it as dynamic form rule?
  • I have not tested recently, but I seem to recall that a file name cannot be used in a form rule, but if you make a formula field called [Drawing (text format)] with a formula of

    ToText([Drawing])

    then for sure that can be used in a form rule.

    I ususally put fields which are used in form rules, on the form in a section hidden to all users, to be sure that the form rule "sees" the current value of the formula field as the form is edited.
  • I have a similar request, but I'm not following the above steps to get my use case to work and was wondering if you could help me.  I want a form rule to show (and require) a checkbox field if a file has been attached.  I created a formula checkbox field called Photo Attest with the following formula If(ToText([FileUpload]) <>"", True, False)  How do I create the dynamic form rule?  I've tried but it won't let me pick the File Upload field if I chose the Photo Attest field as the "when" condition.  I'm just not getting the logic and the syntax of how this all comes together in dynamic form rules...I so wish they'd add if/then statements and multiple conditions in Dynamic Forms.  Thanks!
  • Make a field called file name with a formula of totext([file attachment field]). Then use that text field in your form rule.

    As for multiple conditions, you can have AND and OR type conditions and multiple conditions.
  • HI Mark, this worked great for me as well.  I have taken the process a step further, whereby we write a date/time when this upload took place.  The only challenge i am experiencing, is when the attachment is deleted, it doesn't take the previous date/time away.  I tried doing it with another form rule, but its not working...what am I doing wrong?


  • ToText([FileAttachment]) isn't changing when I select the file in [FileAttachment] so the dynamic rule isn't triggering. What am I missing?
  • Is that field on the form? Quick Base is a bit lazy and does not recalculate Formula fields if they are not in the form. Try adding that field to the form. If that solves the problem you can still hide that field or a section called
    Required for Form Rules

    With a form rule that always hides that section, like some data entry field not equal 999999999
    • IsaacSacolick1's avatar
      IsaacSacolick1
      Qrew Member
      Yeah. It's on the form and it does recalculate when I put other things into the formula, but it doesn't seem to pickup the filename (or anything) from the FileAttachment field.