Deploy the sample

To get this use case working on your system, please follow the following instructions:


It is assumed that you are running AEM Forms on port 4502.

Create database

This sample uses MySQL database to store the adaptive form data. You will need to create the database schema by importing the schema file into MySQL workbench.

Create datasource

You need to create a datasource called StoreAndRetrieveAfData. The code in the OSGi bundle use this datasource name

Create Form Data Model

Form Data Model needs to be created based on this datasource called StoreAndRetrieveAfData. This form data model is used to fetch the mobile phone number associated with the application id. The form data model can be downloaded from here.

Create developer account with nexmo

Create a developer account with Nexmo for sending and verifying OTP codes. Make a note of the API Key and API Secret Key. The data source and form data model have already been created for you against this service and are included with the assets mentioned in the previous step.

Deploy the following OSGi bundles

Deploy the bundle which has the code to store and fetch data from database
Download and unzip the
Deploy the DevelopingWithServiceUser.jar file using the Felix web console.

Deploy the client library

The sample uses 2 client libraries. Import these client libraries into AEM.

Import the custom adaptive form template

The sample forms used in this demo are based on a custom template. Import the custom template into AEM

Import the sample adaptive forms

The 2 forms that make up this sample need to be imported into AEM. The sample forms can be downloaded from here

Open the MyAccountForm in edit mode. Specify the API Key and API Secret values in the appropriate fields in the adaptive form.

Test the solution

Preview the StoreAFWithAttachments
Enter your mobile number including the country code ,fill in your user details and add some attachments. Click the “Save And Exit” button to save the adaptive form and its attachments

Demonstration of the use case

On this page