Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
BedrockMission!

Learn More

View all

Sign in to view all badges

Retrieving data from custom service and displaying in aem adaptive forms

Avatar

Avatar
Validate 1
Level 1
hari_purushotha
Level 1

Likes

0 likes

Total Posts

16 posts

Correct Reply

0 solutions
Top badges earned
Validate 1
View profile

Avatar
Validate 1
Level 1
hari_purushotha
Level 1

Likes

0 likes

Total Posts

16 posts

Correct Reply

0 solutions
Top badges earned
Validate 1
View profile
hari_purushotha
Level 1

04-06-2018

Hi,

I am working on an adaptive form 6.3.

I am working on the scenario,

  1. where I have capture the user entered form data
  2. send it to the custom service
  3. After my business logic is done, I have to return some value back from my service back to the form and that value should be displayed to the user.

The first 2 steps, I have achieved it by writing custom submit action.But I don't have clue how to get back the value from service and display that in the adaptive form.

Can someone please guide me in that approach.

Regards,

Hari

Note:

I am using AEM repository for storing

Accepted Solutions (1)

Accepted Solutions (1)

Avatar

Avatar
Springboard
Level 10
Mayank_Gandhi
Level 10

Likes

316 likes

Total Posts

1,139 posts

Correct Reply

184 solutions
Top badges earned
Springboard
Establish
Validate 1
Contributor 2
Ignite 5
View profile

Avatar
Springboard
Level 10
Mayank_Gandhi
Level 10

Likes

316 likes

Total Posts

1,139 posts

Correct Reply

184 solutions
Top badges earned
Springboard
Establish
Validate 1
Contributor 2
Ignite 5
View profile
Mayank_Gandhi
Level 10

14-06-2018

Hi Hari,

Try using the guideBirdge API here, maybe you can set the id returned from your service in a form hidden field and on guideBridge.submit success, you may just show the field value in the js alert. Below is an approach that I tried :

guideBridge.submit({

  validate: false,

   error : function (guideResultObject) {//log something

   },

  success : function (guideResultObject) {alert(hidden_id.value);

  location.href = "http://www.example.com/ThankYou.html";

  }});

API reference : Adaptive Forms Class: GuideBridge

Thanks,

Mayank

Answers (5)

Answers (5)

Avatar

Avatar
Springboard
Level 10
Mayank_Gandhi
Level 10

Likes

316 likes

Total Posts

1,139 posts

Correct Reply

184 solutions
Top badges earned
Springboard
Establish
Validate 1
Contributor 2
Ignite 5
View profile

Avatar
Springboard
Level 10
Mayank_Gandhi
Level 10

Likes

316 likes

Total Posts

1,139 posts

Correct Reply

184 solutions
Top badges earned
Springboard
Establish
Validate 1
Contributor 2
Ignite 5
View profile
Mayank_Gandhi
Level 10

26-06-2018

Hi Hari,

Any updates on this?

Avatar

Avatar
Springboard
Level 10
Mayank_Gandhi
Level 10

Likes

316 likes

Total Posts

1,139 posts

Correct Reply

184 solutions
Top badges earned
Springboard
Establish
Validate 1
Contributor 2
Ignite 5
View profile

Avatar
Springboard
Level 10
Mayank_Gandhi
Level 10

Likes

316 likes

Total Posts

1,139 posts

Correct Reply

184 solutions
Top badges earned
Springboard
Establish
Validate 1
Contributor 2
Ignite 5
View profile
Mayank_Gandhi
Level 10

14-06-2018

Avatar

Avatar
Validate 1
Level 1
hari_purushotha
Level 1

Likes

0 likes

Total Posts

16 posts

Correct Reply

0 solutions
Top badges earned
Validate 1
View profile

Avatar
Validate 1
Level 1
hari_purushotha
Level 1

Likes

0 likes

Total Posts

16 posts

Correct Reply

0 solutions
Top badges earned
Validate 1
View profile
hari_purushotha
Level 1

14-06-2018

Hi Mayank,

Thanks for your reply..

On clicking of submit button from adaptive form-->A node will be created in the repository with unique ID-->The service will return the unique ID,which need to be displayed as "popup" to the user.

Service -

I am using sling.getservice to connect my service from post.POST.jsp

Form structure:      text field with submit button at the bottom

CRX: Form data are stored as individual node of type -->sling:folder

-Hari

Avatar

Avatar
Validate 25
Level 10
smacdonald2008
Level 10

Likes

1,408 likes

Total Posts

12,671 posts

Correct Reply

2,278 solutions
Top badges earned
Validate 25
Validate 10
Validate 1
Give back 900
Give back 600
View profile

Avatar
Validate 25
Level 10
smacdonald2008
Level 10

Likes

1,408 likes

Total Posts

12,671 posts

Correct Reply

2,278 solutions
Top badges earned
Validate 25
Validate 10
Validate 1
Give back 900
Give back 600
View profile
smacdonald2008
Level 10

14-06-2018

Sounds like Prepopulating Form with Service data - do we have docs for this?

Avatar

Avatar
Springboard
Level 10
Mayank_Gandhi
Level 10

Likes

316 likes

Total Posts

1,139 posts

Correct Reply

184 solutions
Top badges earned
Springboard
Establish
Validate 1
Contributor 2
Ignite 5
View profile

Avatar
Springboard
Level 10
Mayank_Gandhi
Level 10

Likes

316 likes

Total Posts

1,139 posts

Correct Reply

184 solutions
Top badges earned
Springboard
Establish
Validate 1
Contributor 2
Ignite 5
View profile
Mayank_Gandhi
Level 10

14-06-2018

Hi Hari,

Do you want to display the data returned from the service in the form itself or you want to have it some new page like a Thank you Page?

Please share details on service, form structure and how the data is residing currently in the crx?

-Mayank Gandhi