on 2023 May 24 8:35 PM
Hi experts,
In the UI builder I'm creating a Full registration screen with address data. This screen should replace the current webservice form for a account registration. However, in this current registration the customer has added an address validation API. When the postal code and housenumber is filled the API will search for the correct address.
Is such setup also possible with CDC? And how could this be configurated?
Kind regards,
Daan
Request clarification before answering.
Hi dschattenberg
As I understand you want to hit a address validation API in registration screen set. what you need to do is add a fetch request on change of your field in screen set JavaScript. I am adding some reference code for you.
if(event.screen === 'Registration' && event.field === 'profile.zip'){
var requestOptions = { method: 'GET', redirect: 'follow' };
fetch("API_URL?codes="+zipcode+"&country=US", requestOptions)
.then(function(response){
response.json();
}).then(function(result){
// here your action on success Or depends on your API
console.log(result);
})
.catch(function(error){console.log('error', error);});
}
I think this will help you.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
If you want to be very strict about address validation, setup an OnBeforeAccountsRegister extension to validate the user's address server-side. Then adjust the Screensets event logic to handle your extensions error responses. For a better user experience still add client side validation up-front as suggested in this response.
Best,
Sebastian Schuck
| User | Count |
|---|---|
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.