0

Is there a file attached? Display in a table.

Hi, 

Is there a way of displaying in a table whether or not there is a file attached to particular records in a yes/no format.  I suspect there is (but don't know how to do it) because in the form view of a record on the file tab, the little file icon is black if there is a file attached.  It would then be feasible to filter records with a file attached or no file attached, which is what I want to do.  Thanks for any assistance you can give.

khowells@gmail.com

10 replies

null
    • Support
    • 5 yrs ago
    • Reported - view

    Hi, 

    Hi,

    You could use the followin formula in a formula field in order to display, if the data record has an attachment: 

     

    if concat(files(this)) then
    "There are attachments"
    else
    "No attachments"
    end

     

    Best, Jörg

    • khowells
    • 5 yrs ago
    • Reported - view

    Brilliant!  Thanks Jörg, that works a treat.  

    Regards

    Keith.

    • New_Sun
    • 5 yrs ago
    • Reported - view

    When is “no attachment” i want be red color. How can do?

    • blackie
    • 5 yrs ago
    • Reported - view

    Use styled

     

    styled(text, colour, icon) - creates styled text elements. The icon is placed to the left of the text. Use "" for none, and the colour is the objects background
    |  styled("Attention", "red", "warn")

     

    so something like this:

    if concat(files(this)) then
    "There are attachments"
    else
    styled("No attachments","red","")
    end

    • khowells
    • 5 yrs ago
    • Reported - view

    Brilliant!  Thanks Jörg, that works a treat.  

    Regards

    Keith.

    • khowells
    • 5 yrs ago
    • Reported - view

    Thanks blackie.

    Keith

    • New_Sun
    • 5 yrs ago
    • Reported - view

    your welcome, but for me dont work with styled

    my formula is:

    if concat(files(this)) then

    "Attach"

    else

    styled("No attach","red","")

    end

    show me this massege: Return type mismach for then and else expressions,:string,styled at line 5, column 3

    • blackie
    • 5 yrs ago
    • Reported - view

    From the error message it looks like you need to add styled to the then part.

     

    if concat(files(this)) then

    styled("Attach","","")

    else

    styled("No attach","red","")

    end

    • New_Sun
    • 5 yrs ago
    • Reported - view

    yes,worked and thank you.

    • Angel.1
    • 3 yrs ago
    • Reported - view

    Hi, 

    I'm trying to use this code but, since I have other files as image fields in my records, concat(files(this)) is always true.

    Is there any way to check if there's a file in the attachment tab independently of the other image fieds?

    Thank you

Content aside

  • 3 yrs agoLast active
  • 10Replies
  • 2881Views