Calling REST endpoint from code editor

Avatar

Avatar

prabudossh

Avatar

prabudossh

prabudossh

26-07-2019

Hi,

We have a requirement to integrate AEM forms (v6.3) with salesforce. What I understand is there are 2 ways to do it

1. Create a Form data model using salesforce swagger file/URL (Adobe Experience Manager Help | Configuring DataSource with Salesforce in AEM Forms 6.3 and 6.4)​. The only problem with this approach is that there is swagger file/url is not available to us.

2. Call the Rest endpoints from the code editor. I am assuming this is an option. If so appreciate if there is any article/documentation available on the implementation?

Is there any other options available?

Thx,

Prabu

Replies

Highlighted

Avatar

Avatar

prabudossh

Avatar

prabudossh

prabudossh

30-07-2019

As a digital preference, out client has moved away from Google Recaptcha into a 3rd party captcha service. We have implementated as a separate captcha component and is working fine for few other usecases. However I am not sure how do we integrate into AEM forms? 

Highlighted

Avatar

Avatar

workflowuser

Employee

Avatar

workflowuser

Employee

workflowuser
Employee

30-07-2019

will get back to you

Highlighted

Avatar

Avatar

workflowuser

Employee

Avatar

workflowuser

Employee

workflowuser
Employee

31-07-2019

Currently using your own captcha implementation in AEM forms is not supported

Highlighted

Avatar

Avatar

prabudossh

Avatar

prabudossh

prabudossh

31-07-2019

Thanks for the response. Just a wild thought, haven't thought through this in detail yet. Is there a possibility to fetch the values entered in the form into another component. I am just thinking if I can separate captcha form submission and forms into 2 different components in a page.

Alternatively if we use OOTB AEM forms component is it possible for that integration?

Highlighted

Avatar

Avatar

Mayank_Gandhi

Employee

Avatar

Mayank_Gandhi

Employee

Mayank_Gandhi
Employee

31-07-2019

If another component is in form, yes you can easily use the rule or code editor.

You can have a different panel with Captcha and forms component.

Highlighted

Avatar

Avatar

Mayank_Gandhi

Employee

Avatar

Mayank_Gandhi

Employee

Mayank_Gandhi
Employee

31-07-2019

Though I shared an initial response on the query if you can detail the requirement I would add more to it.

Highlighted

Avatar

Avatar

prabudossh

Avatar

prabudossh

prabudossh

31-07-2019

Thanks Mayank. Let me try to add in the details here. we have a requirement to add the user registration into salesforce. The form to capture user registration has the usuals (firstname, lastname, email etc) which needs to be posted into salesforce.  The form also displays a captcha (not google recaptcha but a 3rd party service to render captcha) that should be validated before the actual form submission. So three are 2 parts to this. (1) AEM forms integration with Salesforce (2) AEM forms integration with 3rd party Captcha.

For Reqt(1), I am fairly comfortable to go with OSGI/JS option (currently experimenting on it) but not sure on how to go about reqt(2) though. Based on your above response even if we are able to render the captcha inside the form in a separate panel, how do we tie this to the form submit

Let me know if you need more details, thx

Highlighted

Avatar

Avatar

Mayank_Gandhi

Employee

Avatar

Mayank_Gandhi

Employee

Mayank_Gandhi
Employee

31-07-2019

I was going to suggest to have tabbed navigation in which the next tab gets enabled once you have successfully filled the respective panel.  Now the third party captcha which you are trying to validate would have some callback function and based on the success and failure you enable/Disable the submit button.

Highlighted

Avatar

Avatar

prabudossh

Avatar

prabudossh

prabudossh

31-07-2019

thanks for the response mayank. Yes captcha callback function returns true/false based on user input. I am little lost on how to capture this input and tie it to the submit button?

Highlighted

Avatar

Avatar

Mayank_Gandhi

Employee

Avatar

Mayank_Gandhi

Employee

Mayank_Gandhi
Employee

31-07-2019

Do something like this on callback in code-editor:

if (object.value == "true") {

    submit.enabled = true;

}

Have the submit button disabled by default.