I have trial users who are allowed to upload images to my app to test it out. If a user doesn’t end up subscribing, I want to delete the images and other data they’ve created after 30 days. This seems like it should be easy to do in a backend workflow, but I have a data type Artwork with fields “Creation date” and “createdby” and another data type User with field “subscription status.” I need to create a backend workflow that will delete things from the Artwork data type for all users whose subscription status<> “active” where the artwork Creation date is over 30 days old. I’ve hunted around the forum, but can’t seem to figure out how to create a search based on criteria from two data types. This would be trivial in a traditional database with a JOIN. What am I missing?
When the user initiates their free trial, use a scheduled API workflow and set the runtime to current date + 30 days. Also, pass the user as a parameter. This will run after 30 days. Inside this API workflow, add “delete a list of things.” and for the thing to delete, add “Do a search for artwork” and set the constraint to “created by = User.” Add the condition “only when the user’s subscription status <> active is no” to this deletion action. That’s it.
And if you want to schedule a separate workflow for each artwork individually, then you can perform the same actions when creating each artwork, and then, after 30 days, you can “delete a thing: this artwork.” and add “if artwork created by’s subscription status <> active” to this.