form based activity with AEP profile attribute
Could you confirm that this syntax is all right?
<script>
let country;
try {
country = "${aep.my_org.NextFlight.country default="USA"}";
} catch (error) {
country = "Egypt";
}
</script>
Could you confirm that this syntax is all right?
<script>
let country;
try {
country = "${aep.my_org.NextFlight.country default="USA"}";
} catch (error) {
country = "Egypt";
}
</script>
Your Syntax is alright.
Just that, If statement won’t work in plain JavaScript. Below is the modified version.
Let me know if this works for you.
<script>
let country;
try {
country = aep.my_org.NextFlight.country || "USA";
}
catch (error)
{
country = "Egypt"; // Fallback in case of an error
}
</script>
Thanks.
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.