# Daily Query and Update on a Glide Table

**URL:** https://community.glideapps.com/t/daily-query-and-update-on-a-glide-table/60944
**Category:** Ask for Help
**Created:** [April 25, 2023, 7:51am UTC](https://community.glideapps.com/t/daily-query-and-update-on-a-glide-table/60944 "2023-04-25T07:51:02Z")
**Posts on this page:** 14
**Page:** 1

<div class="post-metadata">

### Author: ![Jonathan](https://avatars.discourse-cdn.com/v4/letter/j/aeb1de/32.png) [@Jonathan](https://community.glideapps.com/u/Jonathan)
#### Post date: [April 25, 2023, 7:51am UTC](https://community.glideapps.com/t/daily-query-and-update-on-a-glide-table/60944/1 "2023-04-25T07:51:03Z")

</div>

Hi,

I have a set of tasks in a table in Glide. I used Glide tables for speed, but am wondering whether I should have used Google Sheets now…

Let’s say I have 20 tasks, and 5 of them are marked as “Recurring” using a checkbox when they are added. These will get completed during the day, but I would like them to re-appear tomorrow as uncompleted.

Basically I need the equivalent of a script that runs at say midnight and finds all rows that are Recurring=True and sets Completed=False.

Is this possible in Glide Tables, or do I need to bite the bullet and move my task data into a Google Sheet and use AppScript to achieve the above?

Thanks in advance for any help!

Jonathan

---

<div class="post-metadata">

### Author: ![Darren\_Murphy](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/darren_murphy/32/47326_2.png) [@Darren\_Murphy](https://community.glideapps.com/u/Darren_Murphy)
#### Post date: [April 25, 2023, 9:39am UTC](https://community.glideapps.com/t/daily-query-and-update-on-a-glide-table/60944/2 "2023-04-25T09:39:22Z")

</div>

I think you can apply a bit of Glide computed column logic here. Try the following:

- In your Tasks table, add a Date/time column. Use this column to record the last time a task was completed. So when a user completes a task, use an action to set that column to the current date/time
- Add an if-then-else column:  
– If Last Completed is within today, then Task Status  
– If Recurring is not checked, then Task Status
- You can then use your if-then-else column to show the Task Status for the current day (checked = completed, not checked = pending)

---

<div class="post-metadata">

### Author: ![Jonathan](https://avatars.discourse-cdn.com/v4/letter/j/aeb1de/32.png) [@Jonathan](https://community.glideapps.com/u/Jonathan)
#### Post date: [April 25, 2023, 9:59pm UTC](https://community.glideapps.com/t/daily-query-and-update-on-a-glide-table/60944/3 "2023-04-25T21:59:30Z")

</div>

Hi Darren,

Thanks for your input. I managed to create the column that records the date/time when a task is completed.

I can get the If/Then/Else to detect whether that column is “within” “today” and return a True/False.

I am struggling with how to also check for the Recurring status being checked. I can’t do an AND within the If/Then/Else calculation can I?

Could you expand on your idea to help me understand that part I am not understanding?

Thanks.

---

<div class="post-metadata">

### Author: ![Jeff\_Hager](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/jeff_hager/32/43_2.png) [@Jeff\_Hager](https://community.glideapps.com/u/Jeff_Hager)
#### Post date: [April 25, 2023, 10:15pm UTC](https://community.glideapps.com/t/daily-query-and-update-on-a-glide-table/60944/4 "2023-04-25T22:15:35Z")

</div>

What exactly isn’t working with @Darren_Murphy’s solution? You can add multiple checks within an IF column. Can you show a screenshot of the IF column configuration? The way I’m understanding, it should work. If the task was completed today then it’s a completed task, so the status should be completed. If not, then it checks if the recurring is checked. If it’s not checked, then it’s a one-off task and should return true. Otherwise, the completed date is not today AND recurring is checked, so it should fall into the ELSE statement where you can return false.

---

<div class="post-metadata">

### Author: ![Jeff\_Hager](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/jeff_hager/32/43_2.png) [@Jeff\_Hager](https://community.glideapps.com/u/Jeff_Hager)
#### Post date: [April 26, 2023, 1:33am UTC](https://community.glideapps.com/t/daily-query-and-update-on-a-glide-table/60944/5 "2023-04-26T01:33:41Z")

</div>

> [@Darren\_Murphy](#):
>
> – If Last Completed is within today, then Task Status  
> – If Recurring is not checked, then Task Status

Just revisiting this, I think we need one more condition added to the IF column to account for empty task dates.

– If Last Completed is within today, then true  
– If Last Completed is empty, then false  
– If Recurring is not checked, then true  
– Else false

@Darren_Murphy correct me if I’m wrong.

---

<div class="post-metadata">

### Author: ![Darren\_Murphy](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/darren_murphy/32/47326_2.png) [@Darren\_Murphy](https://community.glideapps.com/u/Darren_Murphy)
#### Post date: [April 26, 2023, 1:47am UTC](https://community.glideapps.com/t/daily-query-and-update-on-a-glide-table/60944/6 "2023-04-26T01:47:07Z")

</div>

I was working on the assumption that there is an existing boolean column that indicates task status, so I used that in the if-then-else logic. So instead of returning true/false, my logic returns the state of that column (or not). It seems to work… 🤔

 ![CleanShot 2023-04-26 at 09.37.08@2x](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/6/8/682e50c1980aff6b9fa29f9d82a0a340b4d4ea20.png)

 ![CleanShot 2023-04-26 at 09.36.48@2x](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/a/6/a62da2dff0b3cfe41ce9e0d9456a3996459a08db.png)

In the above example:

- Task 1 was last completed yesterday, but as it isn’t recurring the if-then-else returns true
- Task 2 was last completed 2 days ago and Task 3 yesterday. As they are both recurring and neither has been completed Today, both return null
- I don’t bother with an explicit false return, as it’s not really needed

I guess the thing about the above is the boolean “Completed” column is basically redundant, so it would make sense to get rid of that.

---

<div class="post-metadata">

### Author: ![Jeff\_Hager](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/jeff_hager/32/43_2.png) [@Jeff\_Hager](https://community.glideapps.com/u/Jeff_Hager)
#### Post date: [April 26, 2023, 2:50am UTC](https://community.glideapps.com/t/daily-query-and-update-on-a-glide-table/60944/7 "2023-04-26T02:50:48Z")

</div>

Got it. That makes sense.

---

<div class="post-metadata">

### Author: ![Jonathan](https://avatars.discourse-cdn.com/v4/letter/j/aeb1de/32.png) [@Jonathan](https://community.glideapps.com/u/Jonathan)
#### Post date: [April 26, 2023, 8:40am UTC](https://community.glideapps.com/t/daily-query-and-update-on-a-glide-table/60944/8 "2023-04-26T08:40:29Z")

</div>

Hi Jeff and Darren,

Thanks for assisting me. I am new to Glide and still trying to get my head round how some of the functions work.

Maybe it would be clearer if I give you a specific example of what I am trying to achieve.

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

If you can imagine we are looking at this as at 26 April 2023, 9:00 and I have a screen that shows my Task List that are not completed. I rely on the Completed column as a filter for this purpose.

If a task is “Recurring” and has been completed yesterday (or earlier if you haven’t accessed the app over the weekend for example) then I want it to change its “Completed” value back to FALSE if it is TRUE.

Is there any way to do this with the If-\>then-\>else function, or would I have to rely on AppScript and do this within a Google Sheet if I need it to directly update that Completed value based on the above criteria? Or is there another way that I haven’t thought of!

In pure logic terms, I need this:

If (Recurring is TRUE)  
AND (Last Completed date is before today)  
SET (Completed to FALSE).

Jonathan

---

<div class="post-metadata">

### Author: ![Darren\_Murphy](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/darren_murphy/32/47326_2.png) [@Darren\_Murphy](https://community.glideapps.com/u/Darren_Murphy)
#### Post date: [April 26, 2023, 9:07am UTC](https://community.glideapps.com/t/daily-query-and-update-on-a-glide-table/60944/9 "2023-04-26T09:07:34Z")

</div>

What I would do is get rid of the Completed boolean column, and replace it with an if-then-else column, configured along the lines that Jeff suggested. That is:

- If Last Completed is within Today, then true
- If Last Completed is empty, then null
- If Recurring is not checked, then true

Here is how that would look with your sample data:

 ![CleanShot 2023-04-26 at 17.04.33@2x](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/6/4/6480229291ad66f978edbfa20a8cc1beb6d5080d.png)

And here is how the if-then-else column would look:

 ![CleanShot 2023-04-26 at 17.04.55@2x](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/8/9/89bf3918f3fefd76942d7070357dcde7171bbfa2.png)

One important point is that when you use that column as a filter, do not test for true/false. Instead test for is checked/is not checked.

---

<div class="post-metadata">

### Author: ![system](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/system/32/53398_2.png) [@system](https://community.glideapps.com/u/system)
#### Post date: [April 27, 2023, 10:00am UTC](https://community.glideapps.com/t/daily-query-and-update-on-a-glide-table/60944/10 "2023-04-27T10:00:07Z")

</div>

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.

---

<div class="post-metadata">

### Author: ![Darren\_Murphy](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/darren_murphy/32/47326_2.png) [@Darren\_Murphy](https://community.glideapps.com/u/Darren_Murphy)
#### Post date: [April 27, 2023, 10:25am UTC](https://community.glideapps.com/t/daily-query-and-update-on-a-glide-table/60944/11 "2023-04-27T10:25:23Z")

</div>



---

<div class="post-metadata">

### Author: ![Jonathan](https://avatars.discourse-cdn.com/v4/letter/j/aeb1de/32.png) [@Jonathan](https://community.glideapps.com/u/Jonathan)
#### Post date: [April 27, 2023, 10:27am UTC](https://community.glideapps.com/t/daily-query-and-update-on-a-glide-table/60944/12 "2023-04-27T10:27:23Z")

</div>

Hi Darren,

Thanks, I think this works now. I am implementing it on my app and will see for sure tomorrow when hopefully my recurring task will reappear on my list as incomplete 🙂

I am updating my filter to use ifCompleted instead of Completed and will rely on the fact that the Last Completed value is populated instead of the boolean for Completed to confirm a task as “Completed”.

Have you published any apps on Glide that you have people pay for? I am wondering whether I can use Glide for this or whether it will only be just for my prototype. I would like to charge people to use the app maybe as a subscription or a one off payment, but I need to implement some sort of robust way of connecting to a user’s calendar to get part of the app to work (it brings in the next calendar appointment onto the top of the task list in my app).

Jonathan

---

<div class="post-metadata">

### Author: ![Darren\_Murphy](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/darren_murphy/32/47326_2.png) [@Darren\_Murphy](https://community.glideapps.com/u/Darren_Murphy)
#### Post date: [April 27, 2023, 12:09pm UTC](https://community.glideapps.com/t/daily-query-and-update-on-a-glide-table/60944/13 "2023-04-27T12:09:53Z")

</div>

> [@Jonathan](#):
>
> Have you published any apps on Glide that you have people pay for? I am wondering whether I can use Glide for this or whether it will only be just for my prototype. I would like to charge people to use the app maybe as a subscription or a one off payment,

You could publish your App as a template in the Glide Template store, see below:

> [@Template Page Sharing](https://community.glideapps.com/t/template-page-sharing/61047/2):
>

---

<div class="post-metadata">

### Author: ![Jonathan](https://avatars.discourse-cdn.com/v4/letter/j/aeb1de/32.png) [@Jonathan](https://community.glideapps.com/u/Jonathan)
#### Post date: [April 27, 2023, 12:29pm UTC](https://community.glideapps.com/t/daily-query-and-update-on-a-glide-table/60944/14 "2023-04-27T12:29:02Z")

</div>

Thanks. I will consider doing that. Thanks for all your help so far 🙂
