Integration

Creating Adaptive Form using Form Data Model

AEM Forms 6.5

The next step is to create an Adaptive Form and base it on the Form Data Model created in the earlier step.
The user enters the Lead Id and on tabbing out the Marketo service to get the leads by id is invoked. The results of the service operation are then mapped to the appropriate fields of the Adaptive Forms.

  1. Create an Adaptive Form and base it on “Blank Form Template”, associate it with the Form Data Model created in the earlier step.
  2. Open the form in edit mode
  3. Drag and drop a TextField component and a Panel component on to the Adaptive Form. Set the title of the TextField component “Enter Lead Id” and set its name to “LeadId”
  4. Drag and drop 2 TextField components on to the Panel component
  5. Set the Name and Title of the 2 Textfield components as FirstName and LastName
  6. Configure the Panel component to be a repeatable component by setting the Minimum to 1 and Maximum to -1. This is required as the Marketo service returns an array of Lead Objects and you need to have a repeatable component to display the results. However, in this case, we are getting only one Lead object back because we are searching on Lead objects by its ID.
  7. Create a rule on the LeadId field as shown in the image below
  8. Preview the form and enter a valid Lead Id in the LeadID field and tab out. The First Name and Last Name fields should get populated with the results of the service call.

The following screenshot explains the rule editor settings

ruleeditor

Debugging

If you are using the bundles provided with this article, you may want to enable debug logs for the following classes:

  • com.marketoandforms.core.impl.MarketoServiceImpl
  • com.marketoandforms.core.MarketoConfigurationService

Congratulations

You have successfully integrated AEM Forms with Marketo using AEM Forms Form Data Model.

recommendation-more-help
8de24117-1378-413c-a581-01e660b7163e