Table query in App trigger

Hello Team
Is it possible to use the table query in the App Startup trigger (App Started)?
Thanks

Should be, can you elaborate on your specific need?

@jmlowden Thanks for the reply
Hello,

I am trying to calculate the based on the completion of a daily task. The due dates follow these rules:

Daily Due Date:- If the task is performed today at any time, the next due date should be tomorrow at 11:59 PM

Weekly Due Date (Calendar Week):- If the task is completed today, the next due date should be the end of the next week Saturday at 11:59 PM.

Monthly Due Date (Calendar Month):- The next due date should be the last day of the next month

Quarterly Due Date:- The next due date should be the last day of the next quarter.

I need an accurate way to calculate these due dates dynamically based on the task’s completion date. Any suggestions or improvements would be appreciated. and also trigger expression needs to build within tulip provided datetime functions

below table example not giving me what I’m looking for .Any help appreciated

Daily-
ROUNDDATETIME(ADD_TIME(TableRecord.Task Performed On), 1, days), day, up)|

Weekly (Calendar )
ROUNDDATETIME(ADD_TIME(ADD_TIME(@TableRecord.Task Performed On), 7, days), 6, days), day, up)

Monthly (Calendar)
ROUNDDATETIME(ADD_TIME(@TableRecord.Task Performed On), 1, months), month, up)

Quarterly
ROUNDDATETIME(ADD_TIME(@TableRecord.Task Performed On), 3, months), month, up)

Thank you!

Why don’t you calculate that in the moment you save the due date? There you touch every single record anyways…

This seems not to be an issue of Query in a Trigger, but more of looping through records.
(I the firs suggestion does not work, you could run an Automation trough the table every night or so…)

2 Likes

Agree, easier to set all the other due dates at the moment of task completion being recorded, rather than going back to have automations do it, or scrub through records by looping to check for changes and update due dates.

@thorsten.langner @jmlowden
Thanks for the support

My initial approach was to retrieve the “last performed task time” using a table query and then trigger the subsequent steps accordingly.

Upon enter next (Button)steps (Task Completed):

  • Capture the current date and time as the last performed timestamp for that task type.
  • Recalculate the next due dates based on the defined logic.
  • Reset any violations if the task is completed within the due period.

Thank you for reaching out to me. I agree with both of you that the date times should be set at the time of the task. I appreciate your support.