Expand my Community achievements bar.

Learn about Edge Delivery Services in upcoming GEM session
SOLVED

Repeatable Panel: Get submitted values

Avatar

Level 3

Hi community,

 

I have following setup:

  • a repeatable panel with 3 inputs
  • a custom submit action, which calls an OSGI service
  • AEM (Forms) with version 5.7.0

Actually I access to the submitted data in my service via the "_guideValuesMap"-Parameter, because all data is in JSON format and it is easier for me to handle the data. But the problem is, that only the data of the last repeatable panel is saved into the JSON. Even the sling request has only the data of the last repeatable panel.

Only the FormSubmitInfo (data property) has the whole data of all panels. But the XML format isn't easy to handle. If I have to use the FormSubmitInfo, is there a helper class or anything else which I can use to parse the submitted values?

 

Thanks for helping!

Kind regards .. Andrea

 

1 Accepted Solution

Avatar

Correct answer by
Employee

@ajur ,

You need to use JSON Schema as data model to Create the Adaptive Form, if you want the submitted data to be in the JSON format.

You may use getData() method of FormSubmitInfo[0] class to get the form data.

You may also convert the XML to JSON using:

Java: https://stackoverflow.com/questions/1823264/quickest-way-to-convert-xml-to-json-in-java

JavaScripthttps://davidwalsh.name/convert-xml-json

 

[0]:https://www.adobe.io/experience-manager/reference-materials/6-5/javadoc/com/adobe/aemds/guide/model/...

 

View solution in original post

3 Replies

Avatar

Correct answer by
Employee

@ajur ,

You need to use JSON Schema as data model to Create the Adaptive Form, if you want the submitted data to be in the JSON format.

You may use getData() method of FormSubmitInfo[0] class to get the form data.

You may also convert the XML to JSON using:

Java: https://stackoverflow.com/questions/1823264/quickest-way-to-convert-xml-to-json-in-java

JavaScripthttps://davidwalsh.name/convert-xml-json

 

[0]:https://www.adobe.io/experience-manager/reference-materials/6-5/javadoc/com/adobe/aemds/guide/model/...

 

Avatar

Level 3

Hi @Mayank_Tiwari,

thanks for your answer!

Unfortunately I don't use a data model for the form. I created it "From the scratch". So imho there is no possibility to set a JSON format, right?

And yes, I know that I can use the getData()-method for the FormSubmitInfo (I wrote it in my question). So I'll try to convert the XML.

Kind regards, 

Andrea

Avatar

Employee

@ajur By default, the data is submitted in XML format only. If you need the same in JSON, either you should use JSON schema or convert the XML to JSON later. Thanks!