SOLVED

Auto Complete via API

Go to solution
Highlighted
Level 2

Auto Complete via API

I would like to autofill/autocomplete Company field with API. I found on this link useful tips: Reduce Form Abandonment with Google MAP API (I have tried this example and doesn't work for me). It's something that I would reach, but not with Google Map, it's about some else API with companies list. Challenge is that we will have this field on multiple schemes. I have already fetch data with URL query in own custom schema and done autocomplete with bootstrap etc, but we would like to get dynamically in Marketo. Is it webhooks or some JavaScript functionality in Marketo form 2.0? Tips, guidelines!?

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Level 10 - Community Moderator

Re: Auto Complete via API

This CodePen -- quite ancient at this point, as it was first published in 2015! -- shows how to correctly use the Google Places Autocomplete API with a Marketo form: MktoForms2 :: Google Places Autocomplete 

The same general guidelines can be used with any autocomplete library. Use the Marketo Forms JS API every possible place you can. Do not set DOM values directly, for example, as they do not always correspond to Marketo datatypes, use setValues() instead. Unfortunately, you're unlikely to get away completely from DOM native events because the libraries out there don't have a specific integration with Marketo. So be careful using advanced Marketo features such as Visibility Rules in conjunction with such libraries as one could easily break the other.

View solution in original post

3 REPLIES 3
Highlighted
Champion Moderator

Re: Auto Complete via API

Hi Igor Tosic

If I'm understanding it correctly, you wnated to autofill the company name on the Marketo form? Is the correct? Can you provide more details on how you wnat it to work? There are differnet techniques that I have seen and I guess the mostly used is that when a person start typing the company name you provide some suggestion in the drop down, is this what you are trying to achieve here?

OR

You have a few records in your database with missing company and you wnate to populate the company fields for these records? Can you be please more specific on the source of the company data?

i should be able to help once I have more details on what you are trying to do here.

Regards,
Amit

Highlighted
Level 2

Re: Auto Complete via API

Hi Amit,

This is exactly the first thing you mentioned. When you start typing the company name to get dropdown with suggestions.

I have used a simple dropdown library in my HTML template. If you need information, I am available.

BR,

Igor

Highlighted
Level 10 - Community Moderator

Re: Auto Complete via API

This CodePen -- quite ancient at this point, as it was first published in 2015! -- shows how to correctly use the Google Places Autocomplete API with a Marketo form: MktoForms2 :: Google Places Autocomplete 

The same general guidelines can be used with any autocomplete library. Use the Marketo Forms JS API every possible place you can. Do not set DOM values directly, for example, as they do not always correspond to Marketo datatypes, use setValues() instead. Unfortunately, you're unlikely to get away completely from DOM native events because the libraries out there don't have a specific integration with Marketo. So be careful using advanced Marketo features such as Visibility Rules in conjunction with such libraries as one could easily break the other.

View solution in original post