So this is probably some dumb issue but I can’t get my head around it.
I’m pulling in data into the DB that’s created correctly, so basically, I’m pulling in a bunch of data via API, creating new DB items per item in the API list.
So far so good - I created each item with an ID (from the API)
I’m trying to do this:
If an item that matches the same ID is found && created in the last 24hours, then mark this new item as Status ‘new’
Yet when I do this on an ID only basis it works.
When I do this with ID = item's ID & creation date > current date -3 days… it all goes to shit.
Ideally, this scheduler would only run on the original check, aka if the twitter id if found in the db past yesterday, ignore. If it doesn’t find any id, then add it.
This again, doesn’t seem to work in that logic.
Sooo right now I’m scheduling the task irrespective… (which is not optimal) and then doing the check at the per-id task creation:
the step 1 does a full search anyway, so it’s the same.
It’s still not clear if you have other conditionals or if there is something with the order of execution between the actions and the scheduled workflows.
If the search does not find records when adding the creation date constraint, are you sure you actually have records in the database that can match that search?
Ah, the good old back end “is the data really there” gotcha maybe?
Instead of “Schedule on a List” I would suggest you do a recursive workflow. Save everything to the database, and then iterate through it.
That would be my guess, searches should work, but sometimes when you are doing a load of stuff in the back end on lists Bubble loses track of what it has created and searches stop working.
I dumped all the follower data to the DB with a status and then ran a separate process to check that item and updated it, but became slow and hogged the DB.
So i moved to spacing out the checking of items via scheduled tasks.
One thing to think about is “order of operations” (actions in workflows don’t actually fire in sequential order in many circumstances) and also being mindful that writes to the database are asynchronous. I can’t see from the screenshots if it is a problem but just something to think about
There is no harm in reorganising your workflows (with “custom events” , “result of step X” etc) so that the order of operations is very explicit and easy to diagnose. Just a suggestion