Using Form Data Model mechanism we can fetch ACS profile information. The Form Data Model created can then be used to prefill the Adaptive Form or Interactive Channel Document. The purpose of this article is to create the Form Data Model using the swagger file that is provided as part of this article's assets.

To get started please follow the following instructions

  • Download and unzip the assets related to this tutorial.
  • Provide the appropriate settings for Adobe Campaign in OSGi configuration
  • Deploy the bundles using Felix web console
  • Create a service user as mentioned in this article. Make sure to deploy the OSGi bundle associated with the article.
  • Store the ACS private key in etc/key/campaign/private.key. You will have to create a folder called campaign under etc/key.
  • Provide read access to the campaign folder to the service user "data".

Setting configuration settings

AEM Forms need to know the details about your Adobe Campaign Standard instance. These details are provided in the AEM web console configuration as shown below. These settings will be different for your instance. You will also have to upload the private.key file under /etc/key/campaign in the CRX. You will have to create a folder called campaign in the CRX repository.

CampaignConfiguration
THESE ARE DUMMY VALUES. PLEASE DO NOT COPY THESE VALUES

Create Data Source

The data source is created using the swagger file. Swagger files define the REST API that is going to be used to fetch ACS profile. Please take a look at the swagger file. The email id of the user is the input parameter to the API call. The fetched profile information is described in the response section of the swagger file. Please make sure you change the host and basePath in the swagger file to match your ACS instance settings.

To learn more about creating a data source, please follow this tutorial.

Create a data source using the swagger file that is provided as part of this article's assets.  Please make sure you set Authentication Type to Custom Authentication as shown in the screenshot below. Learn more about using custom authentication in your data source. 

 

FetchProfileDataSource

Create Form Data Model

Use the data source created in the earlier step as the basis for your form data model. To learn more about creating the Form Data Model, please follow this link.

Please test the form data model by providing a valid email id of an ACS profile. If everything works well, you should get back the profile details as shown in the screenshot below.

You can now use this Form Data Model as the basis for your Adaptive Form or Interactive Communication document.

 

FetchProfileTest
Profile Data returned from ACS

Download

Download

This work is licensed under a Creative Commons Attribution-Noncommercial-Share Alike 3.0 Unported License  Twitter™ and Facebook posts are not covered under the terms of Creative Commons.

Legal Notices   |   Online Privacy Policy