Expand my Community achievements bar.

form based activity with AEP profile attribute

Avatar

Level 7

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>

Topics

Topics help categorize Community content and increase your ability to discover relevant content.

1 Reply

Avatar

Level 4

@Michael_Soprano 

 

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.