SOLVED

Re: Create new person from SFDC Custom field

Go to solution
Marit_Rossing
Level 3

Create new person from SFDC Custom field

Good day,

I am looking for a way to create a new person/lead based on an email address that is stored in a SFDC Custom Field. I have synced the SFDC Customer Field to Marketo. Now I am trying to use the data (an email) in that field to create a new person. Is this even possible? If yes, how?!? I was thinking to use the data in the field as a token to create a new lead, but I see nowhere the possibility in a flow to create a new lead. Any ideas?

Thanks,

Marit.

1 ACCEPTED SOLUTION

Accepted Solutions
SanfordWhiteman
Level 10 - Community Moderator

Re: Create new person from SFDC Custom field

Yes, it is possible.

It has 4 parts:

  1. Create a form to identify this particular lead creation process
  2. Define a webhook that posts data to the special loopback forms endpoint (/save on localhost)
  3. Monitor the webhook for errors using an operational Smart Campaign
  4. Call the webhook from a Smart Campaign of your choosing

Part 1

Just create a Design Studio form. You do not have to edit it in any way; the default fields are fine, so you can save and approve it immediately. You just need to know the form ID, which will be in the URL. You'll want to give the form an informative name, like Create Lead from Such-and-Such SFDC Field. This name will show up in the Activity Log for the new lead, so you want to know what it means immediately and not confuse it for a public-facing form.

Part 2

Define a webhook like so:

URL:

http://localhost/index.php/leadCapture/save

Request Type:

POST

Template:

Email={{lead.Secondary Email Field}}&munchkinId={{system.munchkinId}}&formid=4567&retURL=success

     Of course substitute your real field name and the numeric form ID in place of 4567.

Request Token Encoding:

Form/Url

Response Type:

None

Here's a screenshot:

pastedImage_12.png

Part 3

You want to make sure this webhook always returns an HTTP 302 response. Any other response code is an error. So create a campaign that listens for errors and set up alerts/subscriptions/etc. accordingly (how to react to errors is up to you).

pastedImage_13.png

Part 4

Create a trigger Smart Campaign with a Call Webhook flow step to call your new Upsert Lead from Field webhook as needed.  What to trigger on is up to you as we aren't familiar with the details of your workflow (whether this field is only filled in once on new leads, if it gets updated over time, etc.).

Also note the webhook definition above is actually an upsert (merge or insert). If it encounters the same email address more than once, it will not add more and more new leads. I assume that's the desired behavior. (Not always creating a new lead with a duplicated email address, every time.)

View solution in original post

11 REPLIES 11
SanfordWhiteman
Level 10 - Community Moderator

Re: Create new person from SFDC Custom field

Yes, it is possible.

It has 4 parts:

  1. Create a form to identify this particular lead creation process
  2. Define a webhook that posts data to the special loopback forms endpoint (/save on localhost)
  3. Monitor the webhook for errors using an operational Smart Campaign
  4. Call the webhook from a Smart Campaign of your choosing

Part 1

Just create a Design Studio form. You do not have to edit it in any way; the default fields are fine, so you can save and approve it immediately. You just need to know the form ID, which will be in the URL. You'll want to give the form an informative name, like Create Lead from Such-and-Such SFDC Field. This name will show up in the Activity Log for the new lead, so you want to know what it means immediately and not confuse it for a public-facing form.

Part 2

Define a webhook like so:

URL:

http://localhost/index.php/leadCapture/save

Request Type:

POST

Template:

Email={{lead.Secondary Email Field}}&munchkinId={{system.munchkinId}}&formid=4567&retURL=success

     Of course substitute your real field name and the numeric form ID in place of 4567.

Request Token Encoding:

Form/Url

Response Type:

None

Here's a screenshot:

pastedImage_12.png

Part 3

You want to make sure this webhook always returns an HTTP 302 response. Any other response code is an error. So create a campaign that listens for errors and set up alerts/subscriptions/etc. accordingly (how to react to errors is up to you).

pastedImage_13.png

Part 4

Create a trigger Smart Campaign with a Call Webhook flow step to call your new Upsert Lead from Field webhook as needed.  What to trigger on is up to you as we aren't familiar with the details of your workflow (whether this field is only filled in once on new leads, if it gets updated over time, etc.).

Also note the webhook definition above is actually an upsert (merge or insert). If it encounters the same email address more than once, it will not add more and more new leads. I assume that's the desired behavior. (Not always creating a new lead with a duplicated email address, every time.)

Sant_Singh_Rath
Level 7

Re: Create new person from SFDC Custom field

Thanks Sanford Whiteman​ fro a detailed summary. This is really helpful. I do need to sync salesforce custom field with marketo, Could you please help me with that as well?

Best regards,
Sant Singh Rathaur
SanfordWhiteman
Level 10 - Community Moderator

Re: Create new person from SFDC Custom field

Please open a new thread for this quite different topic.

Sant_Singh_Rath
Level 7

Re: Create new person from SFDC Custom field

Sure Sanford!

Best regards,
Sant Singh Rathaur
Marit_Rossing
Level 3

Re: Create new person from SFDC Custom field

Thanks Sanford for the very detailed process set up! I will work with my web team to create the hook!

Steven_Vanderb3
Marketo Employee

Re: Create new person from SFDC Custom field

Server side form post is unsupported so this is not the best approach to use.

SanfordWhiteman
Level 10 - Community Moderator

Re: Create new person from SFDC Custom field

Well, it's still in rampant use, even in an official doc about creating duplicates. As long as it works, people will use it.

Of course for me it's just as easy to loop back through a reverse proxy. Other people do not have the skills for that setup, nor the luxury of a robust martech infrastructure to draw on. So I don't want to steer people toward a greater technical burden.

Anthony_Baldman
Level 2

Re: Create new person from SFDC Custom field

@SanfordWhiteman  I am not a developer but was able to create your logic in my instance and it worked. It was perfect since April 2022. I created 3 webhooks (all the same logic) since we wanted to capture up to 3 referral email addresses to then create or update an existing record. I then have another program that sends the referrals an eBook PDF via email. Basically the landing page/form is for existing contacts in our database so they can refer others to receive a PDF book. I created 3 additional email & name fields on the referrer's record to track who they referred. Then on the referee's record, it will show who referred them in the "Referred by Full Name" field.  

 

In the last 2 weeks it stopped working and I am getting an error. 

Error string: Server Returned code 404

 

I believe this URL is no longer working/supported as part of the webhook. 

 
I attached screenshots of the new 404 error, the correct 302 error I was getting before, one of my 3 webhooks referencing the URL above and the flow that creates the leads or updates. Also the form view itself. 
 
This is the flow where the webhooks are called that essentially post to the other form post I created to collect the referral names.
The trigger is the referral form itself. 
Flow insert lead.png
This is the expected error that we see when it correctly posts:
302 error-correct-success.png
404 new error started to receive mid-Oct 2022:
404 error post.png
This is one of 3 webhooks. They are all the same but each references the different Additional Email fields (1, 2 and 3): 
 
Webhook 1.png
 
This is the form view for context that the referrer will fill out and can enter up to 3 people 
Referral form with 3 recipients.png
Adrien
Level 1

Re: Create new person from SFDC Custom field

Hi @SanfordWhiteman, I have the same problem as @Anthony_Baldman since April with the same 404 error code running with my webhook. Support told me to replace by an API but do you have any other solutions please?

Thanks for your help.