Expand my Community achievements bar.

SOLVED

User specific data prefill

Avatar

Level 1

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#Supportedprotocolsforprepo...

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/d...

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!

1 Accepted Solution

Avatar

Correct answer by
Level 3

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 

View solution in original post

1 Reply

Avatar

Correct answer by
Level 3

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