I'm trying to do a SF flow to send a contact to a specific Pardot list based on a quote request submitted in SF. I'm getting confused on how you get the Pardot ID to be able to use the 'Add Pardot Contact to list' apex action. It seems like it should be easy, but I haven't been able to find an easy way to do it? Support and documentation have been no help.
As background, this is what I'm trying to do: Quote Request Submitted in SF -> Get the contact information in Flow -> Does the contact exist in Pardot? -> If Yes, Add to Pardot list /If No, Add to Pardot and then Add to Pardot list.
You have a few challenges here:
- Bulkification: your flow would work well in a Screen Flow, but would utterly fail as a Record-Triggered flow if you do any kind of Contact import.
- Sync timing: you can't rely on the Contact getting the Pardot Prospect Id in time for you to use it when you need it in a single flow.
The Pardot API will let you do what you want, but you'll have to likely build something custom.
To do any kind of bulk processing, you'll need batch sizes of 33 at most, as each Contact could result in 3 API calls (and a transaction has a limit of 100 usually).
- Query to see if Prospect Exists, get the ID (it was mentioned you MIGHT be able to look at the pardot URL on the Contact to get that ID, which might work most of the time.
- If Prospect does NOT exist, create it and hold onto the ID. In this create request, just include the email, the salesforceId (the Contact Id) and optionally first and last name. Let the sync populate all the other fields. If you want the Pardot Campaign to be different, you'll have to include that here too.
- Add Prospect to Static List.
An alternative could be simpler. Just add a custom checkbox field to the Contact that indicates the Contact should be added to the List, then have a Dynamic List look for them. Your Flow (or fav rollup tool) could set the value bulk friendly.