# CASE: add multiple attachments

**URL:** <https://community.silverfin.com/t/case-add-multiple-attachments/651>\
**Category:** Cases\
**Tags:** case, as\_attribute, fori\_loop\
**Created:** [February 13, 2018, 9:49am UTC](https://community.silverfin.com/t/case-add-multiple-attachments/651 "2018-02-13T09:49:59Z")\
**Posts on this page:** 12\
**Page:** 1

<div class="post-metadata">

**Author:** ![sven](https://yyz2.discourse-cdn.com/flex030/user_avatar/community.silverfin.com/sven/32/1495_2.png) [@sven](https://community.silverfin.com/u/sven)\
**Post date:** [February 13, 2018, 9:49am UTC](https://community.silverfin.com/t/case-add-multiple-attachments/651/1 "2018-02-13T09:49:59Z")

</div>

Before in Silverfin, you were able to add only one attachment with following code :

```auto
{% input custom.acc.annex as:file %}

```

Which gives this :  
 ![24](https://canada1.discourse-cdn.com/flex030/uploads/getsilverfin/original/1X/0b842c659c4a3286698b3772726f07fe96a95725.png)

And you could only add one file :  
 ![54](https://canada1.discourse-cdn.com/flex030/uploads/getsilverfin/original/1X/5d400be26b3df62782ff7cec0e1cb8d3d26f4bc1.png)

📣 Now it’s possible to add more than one file at once, or add more files after you added one 📣

By using this tag:

```auto
{% input custom.acc.annex as:file_collection %}

```

So the `file_collection` let’s you add more files:  
 ![43](https://canada1.discourse-cdn.com/flex030/uploads/getsilverfin/original/1X/e1a3c24e36182b5561d63b3225a1ae921e156de8.png)

---

<div class="post-metadata">

**Author:** ![Ugis](https://avatars.discourse-cdn.com/v4/letter/u/bc8723/32.png) [@Ugis](https://community.silverfin.com/u/Ugis)\
**Post date:** [February 13, 2018, 5:17pm UTC](https://community.silverfin.com/t/case-add-multiple-attachments/651/2 "2018-02-13T17:17:16Z")

</div>

Hi Sven,

Nice feature.  
Currently when I upload multiple files it shows two file names in one line.  
That causes table with the fixed size stretch the cell that contains these 2 attachments. Can each file name began in a new row?  
See layout for the table: |–10%–|--46%–|--15%–|--+

 ![Capture](https://canada1.discourse-cdn.com/flex030/uploads/getsilverfin/original/1X/dab89b4253284bcdce3b86db912efeae3795a931.JPG)

Thanks,  
Ugis

---

<div class="post-metadata">

**Author:** ![sven](https://yyz2.discourse-cdn.com/flex030/user_avatar/community.silverfin.com/sven/32/1495_2.png) [@sven](https://community.silverfin.com/u/sven)\
**Post date:** [February 23, 2018, 8:41am UTC](https://community.silverfin.com/t/case-add-multiple-attachments/651/3 "2018-02-23T08:41:40Z")

</div>

Hello @Ugis,

The only way you can get that to work, is to make the first table not fixed (so if you define your table like this :

```auto
|––|--46%–|--15%–|--+

```

That way the first table will stretch so the data is visible  
(or you can add the file/collection on a newline too; that might be an option too).

Let me know if this solves your issue

---

<div class="post-metadata">

**Author:** ![Thijs](https://avatars.discourse-cdn.com/v4/letter/t/a4c791/32.png) [@Thijs](https://community.silverfin.com/u/Thijs)\
**Post date:** [April 16, 2018, 8:49am UTC](https://community.silverfin.com/t/case-add-multiple-attachments/651/4 "2018-04-16T08:49:10Z")

</div>

@sven

Can i change an existant as:file to as:file\_collection?

I does not seem te work?

Before:

```
{% fori detail in current_account.details %}{% if forloop.first %}

|------------------------------|----------|--------------:+
| {% t "Saldo voorraad per" %} {% input detail.custom.date as:date %} | {% input detail.custom.file as:file %} |{% input detail.custom.value as:currency %}{% endif %}{% endfori %}

```

After:

```
{% fori detail in current_account.details %}{% if forloop.first %}

|------------------------------|----------|--------------:+
| {% t "Saldo voorraad per" %} {% input detail.custom.date as:date %} | {% input detail.custom.file as:file_collection %} |{% input detail.custom.value as:currency %}{% endif %}{% endfori %} 

```

I can’t see the already attached file en can’t even add files to it?

 ![image](https://canada1.discourse-cdn.com/flex030/uploads/getsilverfin/original/1X/251ad52b5bae060f3ab8e46a1049a144740c1b2d.png)

Gets this:

 ![image](https://canada1.discourse-cdn.com/flex030/uploads/getsilverfin/original/1X/e00cbbb7a79c90179c8da0b8071d203d675cebcc.png)

---

<div class="post-metadata">

**Author:** ![SamVanEenoo](https://yyz2.discourse-cdn.com/flex030/user_avatar/community.silverfin.com/samvaneenoo/32/134_2.png) [@SamVanEenoo](https://community.silverfin.com/u/SamVanEenoo)\
**Post date:** [April 17, 2018, 7:28am UTC](https://community.silverfin.com/t/case-add-multiple-attachments/651/5 "2018-04-17T07:28:15Z")

</div>

@Thijs what happens when you click on the paperclip?

Changing the as:file to as:file\_collection shouldn’t erase the data stored as long as you don’t change the variable name.

Kind regards

---

<div class="post-metadata">

**Author:** ![Thijs](https://avatars.discourse-cdn.com/v4/letter/t/a4c791/32.png) [@Thijs](https://community.silverfin.com/u/Thijs)\
**Post date:** [April 17, 2018, 12:16pm UTC](https://community.silverfin.com/t/case-add-multiple-attachments/651/6 "2018-04-17T12:16:32Z")

</div>

@SamVanEenoo

Original Code:

```
|------------------------------|----------|--------------:+{% fori detail in current_account.details %}
| {% t "Saldo voorraad per" %} {% input detail.custom.date as:date %} | {% input detail.custom.file as:file %} |{% input detail.custom.value as:currency %}{% endfori %}

```

Input mode:

 ![image](https://canada1.discourse-cdn.com/flex030/uploads/getsilverfin/original/1X/1f98cc21ed7278ee043df04dd722a5bfc78d2a61.png)

When i change it to file\_collection:

Code:

```
|------------------------------|----------|--------------:+{% fori detail in current_account.details %}
| {% t "Saldo voorraad per" %} {% input detail.custom.date as:date %} | {% input detail.custom.file as:file_collection %} |{% input detail.custom.value as:currency %}{% endfori %}

```

Input mode:

 ![image](https://canada1.discourse-cdn.com/flex030/uploads/getsilverfin/original/1X/479abd317dc412bc793f35e36bbbd72a37039560.png)

When I click on the paperclip:

 ![image](https://canada1.discourse-cdn.com/flex030/uploads/getsilverfin/original/1X/1a4fca9872b41062f3ef8bcaece8cde6aeb4dc83.png)

---

<div class="post-metadata">

**Author:** ![SamVanEenoo](https://yyz2.discourse-cdn.com/flex030/user_avatar/community.silverfin.com/samvaneenoo/32/134_2.png) [@SamVanEenoo](https://community.silverfin.com/u/SamVanEenoo)\
**Post date:** [April 17, 2018, 12:46pm UTC](https://community.silverfin.com/t/case-add-multiple-attachments/651/7 "2018-04-17T12:46:01Z")

</div>

Hi Thijs

I justed tested it and got the same issue. Might be a bug. I’ll look further into this and will let your know when I have found a solution.

Kind regards

---

<div class="post-metadata">

**Author:** ![Thijs](https://avatars.discourse-cdn.com/v4/letter/t/a4c791/32.png) [@Thijs](https://community.silverfin.com/u/Thijs)\
**Post date:** [April 24, 2018, 8:51am UTC](https://community.silverfin.com/t/case-add-multiple-attachments/651/8 "2018-04-24T08:51:09Z")

</div>

Any news?

Many thanks!

---

<div class="post-metadata">

**Author:** ![sven](https://yyz2.discourse-cdn.com/flex030/user_avatar/community.silverfin.com/sven/32/1495_2.png) [@sven](https://community.silverfin.com/u/sven)\
**Post date:** [April 24, 2018, 8:55am UTC](https://community.silverfin.com/t/case-add-multiple-attachments/651/9 "2018-04-24T08:55:39Z")

</div>

I’m afraid not @Thijs

The developers have been informed last week; I’ll remind them again. As soon as I have more info, I’ll let you know

PS seems this happens only in a fori-loop. If you change the code outside a fori-loop, this doens’t happen at all.

---

<div class="post-metadata">

**Author:** ![sven](https://yyz2.discourse-cdn.com/flex030/user_avatar/community.silverfin.com/sven/32/1495_2.png) [@sven](https://community.silverfin.com/u/sven)\
**Post date:** [April 24, 2018, 9:25am UTC](https://community.silverfin.com/t/case-add-multiple-attachments/651/10 "2018-04-24T09:25:24Z")

</div>

@Thijs,

Good news: this is back resolved! It was not yet supported for file\_collection in account details. It is now

Thanks for letting us know!

---

<div class="post-metadata">

**Author:** ![Thijs](https://avatars.discourse-cdn.com/v4/letter/t/a4c791/32.png) [@Thijs](https://community.silverfin.com/u/Thijs)\
**Post date:** [April 24, 2018, 10:06am UTC](https://community.silverfin.com/t/case-add-multiple-attachments/651/11 "2018-04-24T10:06:20Z")

</div>

Hi @sven

I can confirm this works!

One more question:

I can’t use the file\_collection in combination with size:mini ?

`{% input detail.custom.verklaring as:file_collection size:mini %}`

![image](https://canada1.discourse-cdn.com/flex030/uploads/getsilverfin/original/1X/a4d8f9cb018e53ae2ca383d63e6799aa73bb4730.png)

---

<div class="post-metadata">

**Author:** ![sven](https://yyz2.discourse-cdn.com/flex030/user_avatar/community.silverfin.com/sven/32/1495_2.png) [@sven](https://community.silverfin.com/u/sven)\
**Post date:** [April 24, 2018, 10:59am UTC](https://community.silverfin.com/t/case-add-multiple-attachments/651/12 "2018-04-24T10:59:41Z")

</div>

No you can’t @Thijs.

Maybe this can be an option though :

> [@CASE: add multiple attachments](https://community.silverfin.com/t/case-how-to-be-able-to-add-multiple-attachments-all-at-once/651/3):
>
> Hello @Ugis, The only way you can get that to work, is to make the first table not fixed (so if you define your table like this : |––|--46%–|--15%–|--+ That way the first table will stretch so the data is visible (or you can add the file/collection on a newline too; that might be an option too). Let me know if this solves your issue
