SOLVED

Not able to add LeadSource standard SFDC field in Marketo Form

Go to solution
aashutosh
Level 1

Not able to add LeadSource standard SFDC field in Marketo Form

Using SubmitForm API to create person record. I downloaded all fields object and found Lead Source as listed in the Marketo Person record fields having "leadSource" as it's API name. But I am not able to add that field in the Marketo form on which data is getting submitted via API. As its not in form definition getting below error.

aashutosh_0-1674679178459.png

 

 

2 ACCEPTED SOLUTIONS

Accepted Solutions
Darshil_Shah1
Level 10 - Community Advisor + Adobe Champion

Re: Not able to add LeadSource standard SFDC field in Marketo Form

Well, if you don’t have the Person Source field on the form in Marketo, then you’d encounter this error. Submit Form is an alternative for synchronizing leads to Marketo and is designed to provide functionality that is equivalent to a Marketo Form submission. It’s not an same as the create/update leads endpoint and your use-case sounds more suitable for the leads create/update POST endpoint instead of form submit endpoint. Unless of course, you want to log a filled out form activity in the person’s activity log that’d trigger campaigns listening for it. If that’s the case then you’d need to add all fields you’re including in payload in your Marketo form asset as well.

View solution in original post

Darshil_Shah1
Level 10 - Community Advisor + Adobe Champion

Re: Not able to add LeadSource standard SFDC field in Marketo Form

I'd recommend using the background form submission instead of the submit form API, as the latter consumes API calls, rate limits, and needs you to route the requests to the backend server for posting to Marketo (as you'd not be able to reference the client credentials on the client side). Processing individual form fill requests via API would always need you to keep the form fills (i.e., API calls) in check to ensure you do not hit the API limits. On the other hand, background form submission using the forms2 JS in general is more robust, versatile, and logs the same form submission activity as well (unless you want to track the granular form fill based on the form name criteria, in which case you'd not be able to use the same hidden form). For the background form submission, you basically get the data submitted by the user, add corresponding hidden fields on hidden Marketo form using the forms2 JS, set the values, and make a form post to Marketo (of course,you would need to load the hidden form on the page first though)

View solution in original post

11 REPLIES 11
Darshil_Shah1
Level 10 - Community Advisor + Adobe Champion

Re: Not able to add LeadSource standard SFDC field in Marketo Form

Well, if you don’t have the Person Source field on the form in Marketo, then you’d encounter this error. Submit Form is an alternative for synchronizing leads to Marketo and is designed to provide functionality that is equivalent to a Marketo Form submission. It’s not an same as the create/update leads endpoint and your use-case sounds more suitable for the leads create/update POST endpoint instead of form submit endpoint. Unless of course, you want to log a filled out form activity in the person’s activity log that’d trigger campaigns listening for it. If that’s the case then you’d need to add all fields you’re including in payload in your Marketo form asset as well.

aashutosh
Level 1

Re: Not able to add LeadSource standard SFDC field in Marketo Form

Seems when we export field list from Marketo, in that the field name is listed as "Lead Source" but in actual on the form it is found as "Person Source".  I added Person Source and it worked with API name "leadSource".

Darshil_Shah1
Level 10 - Community Advisor + Adobe Champion

Re: Not able to add LeadSource standard SFDC field in Marketo Form

The words “Lead/Leads” have been replaced with “Person/People”. While this change has been made to the friendly field names of the fields/and GUI in Marketo, they haven't updated the API names as that would break existing integrations for users.

 

 

SanfordWhiteman
Level 10 - Community Moderator

Re: Not able to add LeadSource standard SFDC field in Marketo Form

To Darshil's point: why, specifically, have you chosen this API endpoint instead of Sync Lead or Push Lead? The Submit Form endpoint is far more cumbersome because it needs to be correspond to an actual form.

aashutosh
Level 1

Re: Not able to add LeadSource standard SFDC field in Marketo Form

Because we have existing custom forms which need to be posted on Marketo.

Darshil_Shah1
Level 10 - Community Advisor + Adobe Champion

Re: Not able to add LeadSource standard SFDC field in Marketo Form

I'd recommend using the background form submission instead of the submit form API, as the latter consumes API calls, rate limits, and needs you to route the requests to the backend server for posting to Marketo (as you'd not be able to reference the client credentials on the client side). Processing individual form fill requests via API would always need you to keep the form fills (i.e., API calls) in check to ensure you do not hit the API limits. On the other hand, background form submission using the forms2 JS in general is more robust, versatile, and logs the same form submission activity as well (unless you want to track the granular form fill based on the form name criteria, in which case you'd not be able to use the same hidden form). For the background form submission, you basically get the data submitted by the user, add corresponding hidden fields on hidden Marketo form using the forms2 JS, set the values, and make a form post to Marketo (of course,you would need to load the hidden form on the page first though)

SanfordWhiteman
Level 10 - Community Moderator

Re: Not able to add LeadSource standard SFDC field in Marketo Form

Everything Darshil said. There's pretty much nothing to recommend the Submit Form API if you have access to the client. You only need to use Submit Form if you have server access to the data only and want to pretend there was a form fillout.

aashutosh
Level 1

Re: Not able to add LeadSource standard SFDC field in Marketo Form

I observed form2 JS reload the page during post submission, which defer us to show success message to the end user. May be I am missing something here. Can you suggest if there is any way to add a redirect page or can use ajax using form2 js?

Darshil_Shah1
Level 10 - Community Advisor + Adobe Champion

Re: Not able to add LeadSource standard SFDC field in Marketo Form

You add the action to be performed (re-direct to a thank-you page or display a success message) using the form.onSuccess method. There are a lot of posts already on the community that deals with this.

 

for example, the below script when added to the page would take use to the set follow-up page on successful form submission -

MktoForms2.loadForm("//abc-ab00.marketo.com", "AAA-BBB-CCC", <form-id>, function(form) {
    
    form.onSuccess(function(values, followUpUrl) {
        // Take the lead to a different page on successful submit, ignoring the form's configured followUpUrl
        location.href = "https://example.com/";
        // Return false to prevent the submission handler continuing with its own processing
        return false;
    });
});

Check out this article on marketing nation that discusses how to let users stay on the same page, hide the form, and display the thank you message on the successful form post.