Schedule API workflow: using type of thing as the constraint

Hi, I am scheduling an API workflow to sync my “event” type with a calendar. An “event” belongs to a “schedule”. “schedule_id” is the parameter that my custom event workflow is based on.

For the list to run on, I am doing a search to filter out any events that have not been modified.

So for the “list to run on”, I want to do a search for Events in which the “data_modified_date” > “event_last_sync_date”. Note that “data_modified_date” and “event_last_sync_date” are all fields for an event.

ISSUE
I can choose “data_modified_date” on the left-hand side of the search constraint but the right hand side only allows me to choose details from the schedule and not evaluating for each event.

How can apply this filter properly?

Thank you.

Not sure to understand your setting, but I don’t think you are scheduling on a list correctly and probably you are not pushing all data you need to run this action.
How the workflow will know the event_last_sync_date information?

Here are more details that hopefully clarify. Please let me know if you have further questions.

This is running from a custom event called “GCal Sync” which takes in a parameter “schedule_id”. The goal is to sync every event that belongs to this “schedule_id”.

The action in “GCal Sync” is to Schedule an API workflow to a backend API Event called “sync events to google calendar” which does the actual sync to the calendar. The input into this backend API Event is the list of events from “GCal Sync”.

So, when I’m Scheduling the API workflow, I am trying to pass in Events which have been modified since the last sync. Therefore in this action:

  • Type of things: “Event”
  • List to run on: “Search for Events” as shown in the screenshot.

Let me know if further clarification is required. Here is an updated screenshot with more of the Action. You see that my list to run on has more than one search conditions but I didn’t get into that detail as it is not critical to resolve the issue I’m looking into here.

Where’s is the date of last sync? Do you store the last time you did the process somewhere?

Yes, I am trying to compare two fields that are at the event level.

Each event has a schedule that it belongs to.

Each event has a “data_modified_date” field for the last time someone made a change to the event as well as a “gcal_event_last_sync_date”. I can’t access the latter field for the right side of the expression UNLESS I reference the schedule_id but then it will pull in a list for every single event rather than evaluating one at a time.

I think I understand. On the event, you want to compare this event data_modified_date with another field of the same item (normally, bubble say This event… but it’s not available there). The only thing I could see if this is not available, is to use advanced filter (:filtered). However, this may not be the best option for WU …

I guess it may be better to handled the next time something need to be updated using another field and maybe trigger event to set this field. I’m not sure of all your settings/process, so I’m not sure of the solution you could use here sorry.

Yes, correct. If I could access “This event…”, that would be amazing. I can’t though as I believe the right hand side of the expression is limited to what is passed into the custom event. In this case the schedule_id. Passing in each individual event doesn’t make sense nor work if I’m thinking about it properly.

Thanks for trying. Let’s see if anyone else has a good solution for this issue.

1 Like

I can’t see a solution from the limited info provided.
But it sounds like you may need to make a change to either your data structure, or the parameters of the custom event (e.g. accept a list of events not a schedule), or even the requirement, e.g. sync every event for the schedule, or sync every event updated since the change triggering the workflow (not just limited to the schedule in question).
Also build a super simple scratchpad app and try and solve the problem with a basic example.