Create new person from SFDC Custom field | Community
Skip to main content
Marit_Rossing
Level 3
December 9, 2018
Solved

Create new person from SFDC Custom field

  • December 9, 2018
  • 2 replies
  • 5748 views

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.

Best answer by SanfordWhiteman

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:

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).

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.)

2 replies

SanfordWhiteman
SanfordWhitemanAccepted solution
Level 10
December 9, 2018

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:

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).

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
Adobe Champion
Adobe Champion
December 10, 2018

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?

~ Sant Singh Rathaur
SanfordWhiteman
Level 10
December 10, 2018

Please open a new thread for this quite different topic.

Suzanne_Wink1
Level 2
January 24, 2019

Have you looked into Salesforce process builder?

Process builder allows you to create a new record based on a triggered action. For example, you can create a new lead record whenever a lead is created with a value for your custom email field. In the final step of the process you can map which field should map to your new Lead Record.

Once the new lead is created in Salesforce it will then flow into Marketo. (assuming the 2 are synced )

Just an idea..

Let me know if you need assistance with this.