Skip to main content
Solved

Display attachment name


Hello,

I need to download a CSV file, displaying the name of the attached files of an Attachment field (without the link).

Do you know how to display only the name of the attached documents ?

Thanks a lot for your help !

Milarépa

Best answer by W_Vann_Hall

Avi_Doe wrote:

Hello!

thanks works fine. I am wondering if it also possible to remove the file type in the name?

Example: attachmentname.pdf = attachmentname


Sure:

LEFT(
    {FullAttachmentName},
    FIND(
        '.',
        {FullAttachmentName}
        )-1
    )
View original
Did this topic help you find an answer to your question?

Forum|alt.badge.img+5

This is based on a tip I posted in ‘Show And Tell’ a while back — with one modification I’ll explain in a moment.

To extract just the name of an attachment, create a formula field using this formula:

LEFT(Attachments,FIND(" (http",Attachments)-1)

[Note that within the FIND() function there is a leading space before the open parenthesis (’(’) character.]

If there are multiple attachments in the {Attachments} field, this will extract the first one returned. (And which is the first one returned? I think it’s the latest one added…)

The original version of this formula, as given in my post, included this call to FIND():
FIND(" ",Attachments).
When I dropped that into a field to double-check the formula before replying to you, though, I discovered one of the attachments in the table I had chosen at random happened to have an embedded space before the file extension, clipping the ‘.pdf’ from the file name. Assuming none of your attachment names contains an embedded ’ (http’, the modified formula should work fine.


W_Vann_Hall wrote:

This is based on a tip I posted in ‘Show And Tell’ a while back — with one modification I’ll explain in a moment.

To extract just the name of an attachment, create a formula field using this formula:

LEFT(Attachments,FIND(" (http",Attachments)-1)

[Note that within the FIND() function there is a leading space before the open parenthesis (’(’) character.]

If there are multiple attachments in the {Attachments} field, this will extract the first one returned. (And which is the first one returned? I think it’s the latest one added…)

The original version of this formula, as given in my post, included this call to FIND():
FIND(" ",Attachments).
When I dropped that into a field to double-check the formula before replying to you, though, I discovered one of the attachments in the table I had chosen at random happened to have an embedded space before the file extension, clipping the ‘.pdf’ from the file name. Assuming none of your attachment names contains an embedded ’ (http’, the modified formula should work fine.


Perfect ! Thanks a lot for your help


Avi_Doe
Forum|alt.badge.img+11
  • Known Participant
  • September 23, 2019
W_Vann_Hall wrote:

This is based on a tip I posted in ‘Show And Tell’ a while back — with one modification I’ll explain in a moment.

To extract just the name of an attachment, create a formula field using this formula:

LEFT(Attachments,FIND(" (http",Attachments)-1)

[Note that within the FIND() function there is a leading space before the open parenthesis (’(’) character.]

If there are multiple attachments in the {Attachments} field, this will extract the first one returned. (And which is the first one returned? I think it’s the latest one added…)

The original version of this formula, as given in my post, included this call to FIND():
FIND(" ",Attachments).
When I dropped that into a field to double-check the formula before replying to you, though, I discovered one of the attachments in the table I had chosen at random happened to have an embedded space before the file extension, clipping the ‘.pdf’ from the file name. Assuming none of your attachment names contains an embedded ’ (http’, the modified formula should work fine.


Hello!

thanks works fine. I am wondering if it also possible to remove the file type in the name?

Example: attachmentname.pdf = attachmentname


Forum|alt.badge.img+5
Avi_Doe wrote:

Hello!

thanks works fine. I am wondering if it also possible to remove the file type in the name?

Example: attachmentname.pdf = attachmentname


Sure:

LEFT(
    {FullAttachmentName},
    FIND(
        '.',
        {FullAttachmentName}
        )-1
    )

Avi_Doe
Forum|alt.badge.img+11
  • Known Participant
  • September 23, 2019
W_Vann_Hall wrote:

Sure:

LEFT(
    {FullAttachmentName},
    FIND(
        '.',
        {FullAttachmentName}
        )-1
    )

wow thanks for your fast help! :heartpulse: :slightly_smiling_face:


Reply