# CSV Output

**URL:** <https://community.glideapps.com/t/csv-output/74042>\
**Category:** Ask for Help\
**Created:** [June 11, 2024, 9:19am UTC](https://community.glideapps.com/t/csv-output/74042 "2024-06-11T09:19:43Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![sid\_pix](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/sid_pix/32/63848_2.png) [@sid\_pix](https://community.glideapps.com/u/sid_pix)\
**Post date:** [June 11, 2024, 9:19am UTC](https://community.glideapps.com/t/csv-output/74042/1 "2024-06-11T09:19:43Z")

</div>

Hi, I have a DB in Glide and have linked a CSV output to the table of data I need. but I wanted to make it so when a user clicks the button only the records registered in the last 24 hours get exported to the CSV. is there any easy way to do this?

---

<div class="post-metadata">

**Author:** ![Eric\_Penn](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/eric_penn/32/73888_2.png) [@Eric\_Penn](https://community.glideapps.com/u/Eric_Penn)\
**Post date:** [June 11, 2024, 11:12am UTC](https://community.glideapps.com/t/csv-output/74042/2 "2024-06-11T11:12:32Z")

</div>

The CSV integration accepts relations and query’s as it source. Set up a relation or query to the data for the last 24 hrs and then use that as the source of the CSV

---

<div class="post-metadata">

**Author:** ![sid\_pix](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/sid_pix/32/63848_2.png) [@sid\_pix](https://community.glideapps.com/u/sid_pix)\
**Post date:** [June 11, 2024, 12:03pm UTC](https://community.glideapps.com/t/csv-output/74042/3 "2024-06-11T12:03:22Z")

</div>

![Screenshot 2024-06-12 at 12.02.45 AM](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/2/0/20efe0bde8b5bc27778e7e6362771fa43c09da35.jpeg)

I dont see how that would help as for csv we have to select a source and the columns for the source. how do I fill it with a query?

---

<div class="post-metadata">

**Author:** ![Eric\_Penn](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/eric_penn/32/73888_2.png) [@Eric\_Penn](https://community.glideapps.com/u/Eric_Penn)\
**Post date:** [June 11, 2024, 12:06pm UTC](https://community.glideapps.com/t/csv-output/74042/4 "2024-06-11T12:06:23Z")

</div>

I believe you want to change “Source data” on the right. Change that from the Attendance table to your Relation or Query instead.

---

<div class="post-metadata">

**Author:** ![sid\_pix](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/sid_pix/32/63848_2.png) [@sid\_pix](https://community.glideapps.com/u/sid_pix)\
**Post date:** [June 11, 2024, 12:07pm UTC](https://community.glideapps.com/t/csv-output/74042/5 "2024-06-11T12:07:46Z")

</div>

![Screenshot 2024-06-12 at 12.07.10 AM](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/5/0/50ba5bbd897f7c35761fc05cd5125d7398dd4ce5.png)

This only allows me to select from existing tables - I would have to create a relational table for this then. is that the suggestion ?

---

<div class="post-metadata">

**Author:** ![Eric\_Penn](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/eric_penn/32/73888_2.png) [@Eric\_Penn](https://community.glideapps.com/u/Eric_Penn)\
**Post date:** [June 11, 2024, 12:24pm UTC](https://community.glideapps.com/t/csv-output/74042/6 "2024-06-11T12:24:07Z")

</div>

Correct you’d have to create a new one. Glide unfortunately does not suggest them for you but that would be neat!

---

<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:** [June 12, 2024, 12:23am UTC](https://community.glideapps.com/t/csv-output/74042/7 "2024-06-12T00:23:11Z")

</div>

Have this setup, maybe in your Users table.

- Add a math column, let’s call it “Cut off”: `Now-1` with `Now` referencing the current time.
- Add a query column pointing to the table you need to export, filter by the record date being after the “Cut off” value.
- Point the export CSV option to that query.
