Question

How to preview multiple files that are stored in a table?

  • 1 September 2022
  • 2 replies
  • 38 views

Userlevel 1

Hello all,

The preview component works well, but it grabs the first file that it encounters in a table row. However, we have two files in a table row. Let's say, we have a proof of purchase, and a discount voucher. Both are obtained through an API call, stored as Base64 and converted back to their binary form after insert. The binary file is stored in the proper storage column linked to the file/filename field. This works flawlessly.

We only get to see the first file, though. The second file is simply ignored. How do we display both files?

Best regards,
- Alex


2 replies

Userlevel 4
Badge +4

You could achieve this is to make 2 variants each with the file you want to see as first column. 

Or make a view on top of that table and use the unpivot function to make columns into rows so every row has only one document and thus will be shown. 

Userlevel 1

Thanks Freddy! We've been playing with ideas. The options you provided didn't quite fit our needs. We ended up storing the files in a separate table. This way, we can preview one file at a time.

Reply