Hopefully simple.

I'm fully ok with making the process and the criteria required, I just need to know how to make the flow that actually performs the deletion.

Obviously there is an action in Process Builder to kick the flow off, how do I tell the Flow what record to delete?



Figured it out, was actually rather simple. I'm operating in the Leads object here.


Create a Flow. The flow only needs two elements:

a) a text variable, input only, which is called PB_LeadID b) a Delete Record action, which has a criteria of Id = PB_LeadID


Create a Process:

a) Insert your criteria (i.e. on Create, if fields are equal to BLAH BLAH BLAH) b) The action is to launch your flow c) Once specified, the action will say a variable is required - PB_LeadID. Set this to be LeadID.

Go in, create a record that doesn't meet the criteria. Nothing should happen on save. Create one that DOES meet the criteria, you should be greeted with the Record Is Deleted page when saving.

Why am I doing this?

Web-To-Lead is letting through instances of record creation with key fields missing (I have no idea why, there are mandatory requirements on the field, but hey ho, this is for the web development team to figure out). This is useless information for us, so we just want it killed.


You will need headless flow for this .Headless flows can trigger from process builder.

For Headless flows you have input and that will be Ids collection .

Bob also wrote how to invoke apex from the flow .This example also demontrsates how to delete records with small Apex .You can use this as well .


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.