Expand my Community achievements bar.

SOLVED

Introduction to prepopulating adaptive form fields

Avatar

Level 7

Hi,

Please refer to the following URL on Introduction to prepopulating adaptive form fields:

https://helpx.adobe.com/aem-forms/6/prepopulate-adaptive-form-fields.html

It discusses prepopulating Adaptive form using XFA form template, XML schema-based adaptive forms and Adaptive Form with no Form Model.

There are two zip files also offered.

Kindly explain how to test these three scenarios.

Thanks,

Rama.

1 Accepted Solution

Avatar

Correct answer by
Administrator

Hi 

Sorry for delay response to this, 

Please have a look at the answer provided by internal team:-

  • For the first zip file:
  1. Download and unzip the zip file, Prefill-Sumbit-XMLsAndContentPackage.zip. The zip file contains a package,PrefillandSubmit.zip and xml files containing sample content.
  2. Import the PrefillandSubmit.zip package to AEM author instance using package share. The following forms are imported to AEM
  • Adaptive form with no form model
  • Adaptive form with XML Schema
  • Adaptive form with XFA
  • A repeatable sub form
  1. Navigate to AEM Forms manager, select a form and preview using the data provided in sample files. For example, to preview the adaptive form with no data model, the URL would be

http://localhost:4502/editor.html/content/forms/af/sampleAFWithNoFormModel.html?wcmmode=disabled&dat... path of data file]/AFWithNoDataModel.xml

  • For the second zip:

There seems to be an issue with the social connector package. The team is unable to login to Facebook using out of the box cloud connector. Team will update you about the second package in a day or two.  

I hope this would be of some help to you.

Thanks and Regards

Kautuk Sahni



Kautuk Sahni

View solution in original post

4 Replies

Avatar

Level 3

Rama, in all cases the forms are still pre-populated the same way. Just the XML will change depending on which model you choose (xfa, schema, no model). Ideally you'll use a schema because if you move fields around in the adaptive form, you'll have the same issue that you had with Designer where the xml output will change based on the field location.

That said, one of the easiest ways to experiment with prepopulating is to create your form, then submit your form to your custom service and look at the structure of the XML submitted. Then, re-create that structure and populate the data node in your pre-fill.

In your post.POST.jsp, use  String formXML = request.getParameter("jcr:data"); to get the string value of the data submitted.

In your profill.jsp, use the reverse,  slingRequest.setAttribute("data", formdata); to populate the data of the form.

Avatar

Level 7

Hi,

Thanks for reverting.

The URL https://helpx.adobe.com/aem-forms/6/prepopulate-adaptive-form-fields.html talks about things involved in bits and pieces, but there no thread that ties all these together.

Could you please send me step by step procedure for achieving a form prefill with just two fields?

Thanks,

Rama.

Avatar

Correct answer by
Administrator

Hi 

Sorry for delay response to this, 

Please have a look at the answer provided by internal team:-

  • For the first zip file:
  1. Download and unzip the zip file, Prefill-Sumbit-XMLsAndContentPackage.zip. The zip file contains a package,PrefillandSubmit.zip and xml files containing sample content.
  2. Import the PrefillandSubmit.zip package to AEM author instance using package share. The following forms are imported to AEM
  • Adaptive form with no form model
  • Adaptive form with XML Schema
  • Adaptive form with XFA
  • A repeatable sub form
  1. Navigate to AEM Forms manager, select a form and preview using the data provided in sample files. For example, to preview the adaptive form with no data model, the URL would be

http://localhost:4502/editor.html/content/forms/af/sampleAFWithNoFormModel.html?wcmmode=disabled&dat... path of data file]/AFWithNoDataModel.xml

  • For the second zip:

There seems to be an issue with the social connector package. The team is unable to login to Facebook using out of the box cloud connector. Team will update you about the second package in a day or two.  

I hope this would be of some help to you.

Thanks and Regards

Kautuk Sahni



Kautuk Sahni

Avatar

Level 7

Hi Kautuk,

Sorry for the delay in responding.

I have been away from system for a while and today only I got a chance to test it.

It works fine. 

Appreciate your help.

Thanks,

Rama.