Backend - Delete list of "Things" that reference a different "Thing"

I have a backend workflow that schedules an API when a database triggers.
I would like to delete all things that referenced an item that has been deleted.
i.e. When “C-Skill” is deleted, I want to delete all the “E-Skills” that previously referenced “C-Skill”

image

I’m not sure where I’m going wrong, but it’s not working for me.
I’d appreciate any advice on how to do this.

Hi there, @rory.mulligan… I could be off base here because I am not necessarily following your exact flow, but I think it could be “flawed” at a base level because it sounds like you are trying to delete a list of things (E-Skills) that are no longer associated with a thing that has already been deleted (C-Skill). If that is the case, you likely have to go the other way and delete the list of things (E-Skills) before you delete the thing with which they are associated (C-Skill).

Does any of that make sense and sound like it might describe what is happening?

Best…
Mike

1 Like

Hi Mike, you are right. It could be just me not fully understanding the capability of Bubble’s backend workflows.

I assumed that using the expression “C_Skill Before Change” would identify the list prior to when the “C_Skill” was deleted.

Is there another way of identifying a list of “E_Skills” that contained the “C_Skill” before it was deleted?

I don’t think so, but why can’t you delete the list of E_Skills" first by searching for the ones that are associated with the C_Skill that is going to be deleted. Then, after the E_Skills are deleted, delete the C_Skill.

1 Like

I just thought there might be a way of doing it from the backend and that it would be quicker for large lists.

I’ve adopted your suggestion, it’s definitely a simpler way of doing it.

Thanks

1 Like

This topic was automatically closed after 70 days. New replies are no longer allowed.