Expandir minha barra de realizações na Comunidade.

Submissions are now open for the 2026 Adobe Experience Maker Awards
SOLUCIONADO

form based activity with AEP profile attribute

Avatar

Level 10

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>

Tópicos

Os tópicos ajudam a categorizar o conteúdo da comunidade e aumentam sua capacidade de descobrir conteúdo relevante.

1 Solução aceita

Avatar

Resposta correta de
Level 5

@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.

Ver solução na publicação original

1 Resposta

Avatar

Resposta correta de
Level 5

@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.