Fill Adaptive Form with Javascript on client Side | Community
Skip to main content
Level 3
July 17, 2024
Solved

Fill Adaptive Form with Javascript on client Side

  • July 17, 2024
  • 1 reply
  • 697 views

Hi,

 

I have a adaptive form on dynamic page. Page data is coming from an API. I need to assign email address coming from api call to one of the email field in adaptive form so I can use that email address to send email. 

 

I'm doing it on front-end with javascript using inputElement.value and inputTlement.setValue(''). I see the email being populated in the form but when I submit the form. That email data is not part of the submit call. 

 

What's the best approach for this use case? 

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Best answer by workflowuser

You will have to use the guide bridge api to set the values of the field in an adaptive form for the dat to be submitted 

1 reply

workflowuserAdobe EmployeeAccepted solution
Adobe Employee
July 18, 2024

You will have to use the guide bridge api to set the values of the field in an adaptive form for the dat to be submitted 

MoiezMaAuthor
Level 3
July 18, 2024

Thank you. For anyone in future need help on this. This is how I did it. 

window.addEventListener("bridgeInitializeStart", function (evnt) { // get hold of the guideBridge object var gb = evnt.detail.guideBridge; //wait for the completion of adaptive forms gb.connect(function () { //this function will be called after adaptive form is initialized var somExpression = "SOM_EXPRESSION_VALUE"; var eligibilityAmountComp = gb.resolveNode(somExpression); eligibilityAmountComp.value = "VALUE"; }) })