Unable to read the response back when using submit action in AEM forms

Avatar

Avatar

rohitn62196663

Avatar

rohitn62196663

rohitn62196663

02-05-2018

I am trying to submit the entire form data using the submit action in AEM forms. I have my own custom submit action which is built on top of the OOTB "sumit to REST endpoint" action. So I am able to hit the end point which I configured within the submit action but I am unable to read the response back to UI. I dont want to redirect it to another thank you page. My app is a single page application so I just want to write the response back to UI so that I can read the response. I have gone through the adobe docs and my code is below:

guideBridge.registerConfig("submitConfig", {"useAjax" : true});

guideBridge.submit({

  validate: false,

  error : function (guideResultObject) {console.log("error occured");},

  success : function (guideResultObject) {console.log("success occured");

}

});

But I am unable to read the response the end point is writing back to my custom action. All I see in the "guideResultObject" is

"{"thankYouOption":"page","thankYouContent":"<currentpageUrl>/jcr:content/guideContainer.guideThankYouPage.html?owner=admin&status=Submitted"}", status: "Submitted"}

I think there are some internal GuideSubmitServlet scripts which are intercepting the request and adding these params to the response. Is there a way to stop this and send the my custom response back to UI ?

Thanks in advance.

Accepted Solutions (0)

Answers (5)

Answers (5)

Avatar

Avatar

rohitn62196663

Avatar

rohitn62196663

rohitn62196663

03-05-2018

Any update from the forms team please ?

Avatar

Avatar

Mayank_Gandhi

Employee

Avatar

Mayank_Gandhi

Employee

Mayank_Gandhi
Employee

02-05-2018

Please refer below forum discussion where a similar query was discussed.

"status" and "owner" parameters are not required in form action

Avatar

Avatar

akhilat9657589

Avatar

akhilat9657589

akhilat9657589

24-10-2018

Hi Rohit,

Were you able to fix this?

Thanks,

Akhila

Avatar

Avatar

rohitn62196663

Avatar

rohitn62196663

rohitn62196663

02-05-2018

yup I see that code snippet in the OOTB action too. However even after that it didn't remove the params. And also I am not sure from where this TYoption and TYpagecontent is coming in the params.

I am trying to see if there are any methods in GuideUtils class which would help me with this.

Avatar

Avatar

smacdonald2008

Total Posts

12.7K

Likes

1.4K

Correct Answer

2.3K

Avatar

smacdonald2008

Total Posts

12.7K

Likes

1.4K

Correct Answer

2.3K
smacdonald2008

02-05-2018

Checking with the Form team to see if we have any example of this use case. We have use cases on custom actions and handling form data in an OSGi bundle - but not writing out the submitted form back on the original form.