Filter table based on scheduled trigger

Options

I have a process that uses 2 scheduled triggers daily. The first run is at 7:00 AM and the second run at 5:00 PM.
In the process, I want to filter a large data table from a different process for only the rows that got added after the previous run, e.g. for the process that runs at 5 PM, I want to only filter for rows that got added between 7 AM and 5 PM on that same day.
How can I set up my filter accordingly? Do I have to use the "Adjust a date & time" action in order for this to be feasible?

Answers

  • Chris_573086
    Chris_573086 Posts: 14 admin
    Options

    Hi Veronika,

    If the goal of the workflow is to process all of the rows that happened since the previous run, it may be easier to use rows from the master data table as opposed to hard coding logic that uses the hour of the day. This also makes it easier to update the triggers that start the run, since the time of day won't impact the logic of the workflow any longer.

    Some terms I'll use:
    Workflow A - the workflow that is running twice a day, and applying the filter logic
    Workflow B - the other workflow mentioned
    Master Table - the Master data table that lists all of the instances of Workflow A

    1. In Workflow A, add a Maximum Data in a Column step and point at it at the Master Table column "Instance end date". This will give you the most recently completed run date and time.
    2. If needed, add a step to Workflow A that reformats the date/time value you fetched in Step 1 to whichever format is required for the table filter action.
    3. You can now use this value in your Tables: Apply Filters step to grab the relevant rows generated by Workflow B.