Webhook to Create a new Salesforce Lead.

Highlighted

Webhook to Create a new Salesforce Lead.

We have a referral form and would like to create a new lead in Salesforce with fields populated on a referral form.  Does anyone know how to accomplish this?

Our Form's Fields:

REFERRAL INFORMATION (we would like to use these fields to create a new lead in salesforce)

  • These are custom Salesforce fields:
    • Referral First Name
    • Referral Last Name
    • Referral Email Address
    • Referral Company
    • Referral Country
    • Referral Phone
    • Referral Postal Code

YOUR INFORMATION (this is the person referring the lead and who Marketo tracks as the person who filled out the form)

  • These are the standard Salesforce fields:
    • First Name
    • Last Name
    • Email Address
    • Company

Referral Form2.JPG

15 REPLIES 15
Highlighted
Level 10 - Champion Alumni

Re: Webhook to Create a new Salesforce Lead.

There is a similar thread earlier.

I suggest doing a search for "referral form" in the community. you will find a lot of detail on what others have done.

Also, I'm not sure why you mention a webhook here. You would want to use jquery most likely and then pass the information to Marketo first.

Highlighted

Re: Webhook to Create a new Salesforce Lead.

I have searched the community and can't find anything to accomplish what I am looking for.  I do not know where to start using jquery.

Highlighted
Level 10 - Community Moderator

Re: Webhook to Create a new Salesforce Lead.

I think what Josh is getting at here is you may have an X-Y problem: asking how to do X before researching to find out Y is a better goal.

In this case, you can use SFDC Web-to-Lead directly from the page with the Marketo form, when the form submits. Then you kill both birds from the browser, no webhook necessary.

Highlighted

Re: Webhook to Create a new Salesforce Lead.

Hi Sanford,

Could you expand a little bit more about what you mean by using the SFDC Web-to-Lead directly from the page with the Marketo form when the form submits?

Thank you

Highlighted
Level 10 - Champion Alumni

Re: Webhook to Create a new Salesforce Lead.

Typing in "referral" to the search box came up with dozens of ideas.

Referral Program widget

Referral program without referral offer feature

Referral offer and referral form

Referral Form Best Practice

here are a few which may be related to your issue.

From your response, I think the best thing to do is design what you want on paper and then go discuss it with your SFDC Admin and/or a developer who knows jquery and Apex code.

What Sanford says will also likely work. What he means is to create a SFDC W2L form in SFDC and have the bottom form post to SFDC to create a lead. If you do not know how to do this, speak with your SFDC Admin or visit support.salesforce.com. They will show you how.

Highlighted
Level 10 - Community Moderator

Re: Webhook to Create a new Salesforce Lead.

In a nutshell, Web-to-Lead is an SFDC feature that allows you to post a simple HTML form (not even a more sophisticated Ajax form) to a URL @ Salesforce.com and have it automatically create and/or route leads.

There's no need for that form to be visible to the user at before it's posted.

So you can use a Marketo form to submit the referrer information and then, using the Marketo Forms API's onSuccess hook, post the referral's information over to SFDC silently, from the same page.

Unfortunately I'm on vacation this week so I may not have a chance to put up my usual demo, but I promise I will early next week.

Highlighted

Re: Webhook to Create a new Salesforce Lead.

Sanford Whiteman​ - I'm trying to figure out how to implement this and am stuck on this part on how to tie the Marketo form to the Web2Lead form:

then, using the Marketo Forms API's onSuccess hook, post the referral's information over to SFDC silently, from the same page.

Do you have a demo that you can share?

Highlighted
Level 10 - Community Moderator

Re: Webhook to Create a new Salesforce Lead.

Do you have your Web-to-Lead form generated from SFDC? You'll need to know the fields on that form, and its action attribute (i.e. the form's {{endpoint URL}}.salesforce.com) to invoke it from the Marketo form.

Highlighted

Re: Webhook to Create a new Salesforce Lead.

The easiest way to do this without "coding" is to create the new "referred" Lead in Marketo, then sync it to SFDC. Submit the form to Marketo as seen above. The referred Lead's data is stored in the custom Fields. Now you have to use a Webhook in a creative way: use it to submit a Form on your own Marketo instance to create the new Lead. To do so, you need to pass in the "referred" email address in the normal Marketo email field, that will cause a new Lead to be created.

Details:

  • URL: http://localhost/index.php/leadCapture/save
  • Payload template: munchkinId=AAA-000-BBB&formid=000&Email={{lead.Referral Email Address}}&FirstName={{lead.Referral First Name}} etc.
    • Make sure to put in your own munchkinId, create a new Form and put in the right formid (look at the URL to find the ID)
  • Request Type: POST
  • Request Token Encoding: Form/Url
  • Response Type: none

Also make sure that you add a field that indicates the source of this Lead. You need to trigger a Smart Campaign that then syncs this new Lead to SFDC. If you want, you can also push in an SFDC Campaign ID or other information that you want to push to SFDC for this new Lead.