Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

ConfiForms: How to display only one of multiple attachments in TabelView?

Vaibhav Gupta
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
July 29, 2021

Hello

In my form, there is an input field for attaching images. Most entries have multiple images associated with them.

On a separate page, I am displaying the collected entries via the TableView Macro. However, when I add the attachment field for display (as one of the table columns), it displays all the attached images in that column (which quickly becomes a problem for entries with 5+ images).

Is there a way for me to only display the first one or two files attached to a ConfiForm Entry? My attempts to use asAttachment/asAttachments have resulted in it displaying 'IMG_NAME.png' in that column, instead of the actual image.

Thank you.

1 answer

1 accepted

2 votes
Answer accepted
Alex Medved _ConfiForms_
Community Champion
July 29, 2021

Hi

I would actually approach this a bit differently, via CSS

With something like this injected on the page (via HTML macro for example)

<style> 
.cf_file_preview_block > .cf_file_preview_item { display:none; }
.cf_file_preview_block > .cf_file_preview_item:nth-child(1) { display:block; }
</style>

Alex

Vaibhav Gupta
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
July 29, 2021

The injected style works exactly as shared to display one image (for anyone else who reads this in the future), although I may tweak it a bit for my use case.

Thank you so much for your help.

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events