So, I am developing a record triggered flow that will create or delete campaign members depending on the status of 5 custom checkboxes in the Lead object, so, when the checkboxes are ticked or unticked, that lead is added or removed from the corresponding campaign.
So far it is creating the Campaign Members with no issues, however, I can't get it to delete existing records when the checkboxes are updated.
These are the entry conditions:
[
Then I decide whether the flow is going to create a campaign member or delete it:
These are the conditions for creating: and deleting
Then, for each branch I ask if the lead needs to be added or deleted from each campaign, a lead can be added or deleted from multiple campaigns at the same time:
Focusing on the deletion branch, this is how I'm asking if a specific checkbox was unchecked:
And if that condition is met, I'm looking for the campaign member with that Lead and Campaign ID, and storing that ID in a collection variable
I'm using that collection variable to store the campaign members of the 5 campaigns and then using a delete records element at the end of the flow to delete the records
Since both branches are pretty similar, I guess the delete records part is the one that is not working, but I don't see how, I really appreciate any guidance.