Expand my Community achievements bar.

SOLVED

Displaying API Response on Second Page in AMP Mailer After Form Submission

Avatar

Level 2

Hi everyone,

 

I'm working on an AMP mailer that allows customers to fill out a form. After they submit the form, I need to:

a) Collect the form data.
b) Call an external API using the collected parameters.
c) Display the API response calculated field on the next page.

 

My main challenge is how to display the API response on the second page of the AMP mailer after the customer submits the form. Could anyone guide me on implementing this functionality in AMP?

1 Accepted Solution

Avatar

Correct answer by
Level 2

Hi @_Manoj_Kumar_ Thank you for the help but I figured out the issue. I was using response.write() to output the response , but it wasn't working. So, I tried using only write() to send the response, and now, after the AMP form submission, I'm able to output the responses on the next page.

 

View solution in original post

4 Replies

Avatar

Community Advisor

Hello @Vishwadeep 

 

Look at this example where data is refresh from a server call

 

Advanced server requests


     Manoj
     Find me on LinkedIn

Avatar

Level 2

Hi @_Manoj_Kumar_ ,

 

I'm using JSSP to consume form data and will make an external API call to retrieve the Calculated Amount and Total Amount as responses. However, the main challenge I'm encountering is how to pass these variables back as responses to AMP to display after the initial form submission.

 

Regards,

Vishwadeep

Avatar

Community Advisor

Hey @Vishwadeep  Could you please share sample data that you want in email. I will try to test it out.


     Manoj
     Find me on LinkedIn

Avatar

Correct answer by
Level 2

Hi @_Manoj_Kumar_ Thank you for the help but I figured out the issue. I was using response.write() to output the response , but it wasn't working. So, I tried using only write() to send the response, and now, after the AMP form submission, I'm able to output the responses on the next page.