User specific data prefill | Community
Skip to main content
New Participant
January 31, 2017
Solved

User specific data prefill

  • January 31, 2017
  • 1 reply
  • 1198 views

I was wondering if there was a well defined way to prefill a form with user specific data.

I see the method for populating via the sling request data attribute

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

But my forms are being used in other systems, that do not have AEM controlled jsps.

 

Ideally I would like use the http protocol dataRef, which would make a call to an AEM servlet to get the desired XML.

http://localhost:4502/content/forms/af/xml.html?wcmmode=disabled&dataRef=http://localhost:4502/bin/dataprefill.xml

However, when doing this the user's session is not available because the call to http://localhost:4502/bin/dataprefill.xml is made server side instead of being made by the user.

 

Is there a way to tie this servlet request to a user's session so I could make use of AEM sessions the same way normal requests are able to?

If not, how difficult would it be to overwrite the OOTB call to dataRef url to be able to modify it to pass along the cookies (and thus the session) for that user to the dataRef url call?

 

Thanks!

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Best answer by Sakshi5

Yes, we do support such scenarios / use cases. You can write a prefill service [0]. In the prefill service, you can get user data and pass it on.

Once you have created a prefill service, you can associate it with adaptive form. It could be configured in Form container dialog using authoring

[0] 'AEM Forms prefill service' section of https://helpx.adobe.com/aem-forms/6-2/prepopulate-adaptive-form-fields.html 

1 reply

Sakshi5
Sakshi5Accepted solution
Employee
January 31, 2017

Yes, we do support such scenarios / use cases. You can write a prefill service [0]. In the prefill service, you can get user data and pass it on.

Once you have created a prefill service, you can associate it with adaptive form. It could be configured in Form container dialog using authoring

[0] 'AEM Forms prefill service' section of https://helpx.adobe.com/aem-forms/6-2/prepopulate-adaptive-form-fields.html