Sign in to Community
Sign in to view all badges
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
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.
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?
Yes, we do support such scenarios / use cases. You can write a prefill service . 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
 'AEM Forms prefill service' section of https://helpx.adobe.com/aem-forms/6-2/prepopulate-adaptive-form-fields.html