Expand my Community achievements bar.

SOLVED

Fill Adaptive Form with Javascript on client Side

Avatar

Level 3

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? 

1 Accepted Solution

Avatar

Correct answer by
Employee Advisor

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 

View solution in original post

2 Replies

Avatar

Correct answer by
Employee Advisor

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 

Avatar

Level 3

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";
            })
        })