Discussions

Expand all | Collapse all

Testing for a file attachment

  • 1.  Testing for a file attachment

    Posted 08-15-2016 05:55

    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? 



  • 2.  RE: Testing for a file attachment

    Posted 08-15-2016 11:02
    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


  • 3.  RE: Testing for a file attachment

    Posted 08-15-2016 13:15
    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?


  • 4.  RE: Testing for a file attachment

    Posted 08-15-2016 13:38
    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.


  • 5.  RE: Testing for a file attachment

    Posted 08-15-2016 13:41
    Thanks a lot.  This is all good.


  • 6.  RE: Testing for a file attachment

    Posted 03-29-2017 18:11
    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!


  • 7.  RE: Testing for a file attachment

    Posted 03-29-2017 18:48
    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.


  • 8.  RE: Testing for a file attachment

    Posted 09-28-2018 03:02
    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?




  • 9.  RE: Testing for a file attachment

    Posted 11-16-2018 12:19
    ToText([FileAttachment]) isn't changing when I select the file in [FileAttachment] so the dynamic rule isn't triggering. What am I missing?


  • 10.  RE: Testing for a file attachment

    Posted 11-16-2018 13:09
    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


  • 11.  RE: Testing for a file attachment

    Posted 11-16-2018 17:35
    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.


  • 12.  RE: Testing for a file attachment

    Posted 11-16-2018 18:55
    Sorry, no ideas.