Expand my Community achievements bar.

Dive into Adobe Summit 2024! Explore curated list of AEM sessions & labs, register, connect with experts, ask questions, engage, and share insights. Don't miss the excitement.

Submit PDF and json/xml to 3rd party system from Adaptive form

Avatar

Level 2

I have been working with Livecycle before, but now I'm doing some AEM Forms 6.4 and have no clue to solve this. Could you help me with some guidiance?

I want to have a adaptive form that the user can fill in. After the user has filled it in, they should be able to click "Submit" and we send an PDF and json/xml(of the data in the form) to a 3rd party system and redirect the user to a "thank you"- page with the PDF that they can download.

I have created a adaptive form thats sends a post, but where do I add the PDF, json/xml and redirects it?

5 Replies

Avatar

Employee Advisor

You have multiple option in the out of the box submit. You can probably use the submit to rest endpoint and map the post URL in the field. You will have to iterate the request parameter on the servlet that it submits to and send it further as required. You can configure the thank You page as well in the same submit action.

 

https://helpx.adobe.com/in/experience-manager/6-3/forms/using/configuring-submit-actions.html

Avatar

Level 2

Right now my POST looks like this

------WebKitFormBoundarypl5WMcXXSIhKex0X
Content-Disposition: form-data; name="guideContainerPath" /content/forms/af/submittest/jcr:content/guideContainer
------WebKitFormBoundarypl5WMcXXSIhKex0X
Content-Disposition: form-data; name="aemFormComponentPath"
------WebKitFormBoundarypl5WMcXXSIhKex0X
Content-Disposition: form-data; name="_asyncSubmit" false
------WebKitFormBoundarypl5WMcXXSIhKex0X
Content-Disposition: form-data; name="_charset_" UTF-8
------WebKitFormBoundarypl5WMcXXSIhKex0X
Content-Disposition: form-data; name="runtimeLocale"< en
------WebKitFormBoundarypl5WMcXXSIhKex0X
Content-Disposition: form-data; name="fileAttachmentMap" {}
------WebKitFormBoundarypl5WMcXXSIhKex0X
Content-Disposition: form-data; name="afSubmissionInfo" {"computedMetaInfo":{},"signers":{}}
------WebKitFormBoundarypl5WMcXXSIhKex0X
Content-Disposition: form-data; name="name" John Doe
------WebKitFormBoundarypl5WMcXXSIhKex0X
Content-Disposition: form-data; name="jcr:data" <?xml version="1.0" encoding="UTF-8"?>
<afData><afUnboundData><data><name>John Doe</name></data></afUnboundData><afBoundData><data xmlns:xfa="http://www.xfa.org/schema/xfa-data/1.0/"/></afBoundData><afSubmissionInfo><computedMetaInfo/><signers/><afPath>/content/dam/formsanddocuments/submittest</afPath><afSubmissionTime>20200116013642</afSubmissionTime></afSubmissionInfo></afData>
------WebKitFormBoundarypl5WMcXXSIhKex0X
Content-Disposition: form-data; name="jcr:data@TypeHint" Binary
------WebKitFormBoundarypl5WMcXXSIhKex0X
Content-Disposition: form-data; name=":redirect" /content/forms/af/submittest/jcr:content/guideContainer.guideThankYouPage.html
------WebKitFormBoundarypl5WMcXXSIhKex0X
Content-Disposition: form-data; name=":selfUrl" /content/forms/af/submittest
------WebKitFormBoundarypl5WMcXXSIhKex0X
Content-Disposition: form-data; name="_guideValueMap" yes
------WebKitFormBoundarypl5WMcXXSIhKex0X
Content-Disposition: form-data; name="_guideValuesMap" {"name":"John Doe","button1579175911492":null,"reset":null,"saveGuideDraft":null,"submit":null}
------WebKitFormBoundarypl5WMcXXSIhKex0X
Content-Disposition: form-data; name="_guideAttachments"
------WebKitFormBoundarypl5WMcXXSIhKex0X
Content-Disposition: form-data; name=":cq_csrf_token" eyJleHAiOjE1NzkxNzk3MDMsImlhdCI6MTU3OTE3OTEwM30.fOaF2_mbWw-Q8-mZJwJXxfJPZPi8xYVDcsmKW2ne-s4
------WebKitFormBoundarypl5WMcXXSIhKex0X--

 

The problem is that I don't know where to programmatically write what I want to send. Normally I would write an XMLHttpRequest in the button in javascript and grab the XML data and the PDF and send it. Now I don't know how I send the DOR (the filled in web form as a PDF).

 

 

Avatar

Employee Advisor
I have messaged you directly. please check

Avatar

Employee Advisor

are you using AEM forms on OSGi or JEE?

Avatar

Level 2
I got an AEM forms 6.4 Author JEE instance and an AEM forms Publish OSGi instance.