# Is there a better way to display filenames of multiple files?

**URL:** <https://community.glideapps.com/t/is-there-a-better-way-to-display-filenames-of-multiple-files/68179>\
**Category:** Ask for Help\
**Created:** [November 28, 2023, 2:34am UTC](https://community.glideapps.com/t/is-there-a-better-way-to-display-filenames-of-multiple-files/68179 "2023-11-28T02:34:41Z")\
**Posts on this page:** 1\
**Showing post:** 4

<div class="post-metadata">

**Author:** ![ThinhDinh](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/thinhdinh/32/49_2.png) [@ThinhDinh](https://community.glideapps.com/u/ThinhDinh)\
**Post date:** [November 29, 2023, 11:41pm UTC](https://community.glideapps.com/t/is-there-a-better-way-to-display-filenames-of-multiple-files/68179/4 "2023-11-29T23:41:01Z")

</div>

![image](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/5/e/5e9d854ca006befd3015973f6c0dcdc6bf446401.png)

Here’s my approach.

 ![image](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/b/c/bcb0846c8cb52548f6a14be5d330c443b724828e.png)

 ![image](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/2/2/22d29f9f9dcb953cd49241395ef378dfded1f29d.jpeg)

```auto
function generateLinksHTML(urlString) {
  // Splits the comma-delimited string into an array of URLs
  const urls = urlString.split(',');

  // Decodes URL-encoded characters using decodeURIComponent
  const decodeUrls = urls.map(url => decodeURIComponent(url));

  // Defines the inline CSS for the pill-style links
  const linkStyle = 'padding: 8px 15px; background-color: #613DC7; color: white; text-decoration: none; border-radius: 20px; margin: 5px; display: inline-block; font-size: 14px;';

  // Creates an HTML string with anchor tags for each URL, including the ↗ emoji
  const linksHTML = decodeUrls.map(url => {
    const fileName = url.split('/').pop();
    return `<a href="${url}" target="_blank" style="${linkStyle}">↗ ${fileName}</a>`;
  }).join('');

  // Returns the full HTML string
  return `<div class="links-component" style="margin-bottom: 10px;">${linksHTML}</div>`;
}

return generateLinksHTML(p1)

```

---

_[View the full topic](https://community.glideapps.com/t/is-there-a-better-way-to-display-filenames-of-multiple-files/68179)._
