Execution Metadata Function with a condition | Community
Skip to main content
Level 2
February 19, 2026
Solved

Execution Metadata Function with a condition

  • February 19, 2026
  • 2 replies
  • 47 views

I'm encountering an error when executing the code below within an HTML AJO file.

 

{{executionMetadata key='CODIGO' value=

{%#if profile._cogna.cogna_student_profile_attributes.DS_ASSINATURA = "PITAGORAS" %}

    '2'    

{%else if profile._cogna.cogna_student_profile_attributes.DS_ASSINATURA = "UNIC" %}

        '3'    

{%else if profile._cogna.cogna_student_profile_attributes.DS_ASSINATURA = "UNIDERP" %}

        '4'    

{%else if profile._cogna.cogna_student_profile_attributes.DS_ASSINATURA = "UNIME" %}

        '5'    

{%else if profile._cogna.cogna_student_profile_attributes.DS_ASSINATURA = "UNOPAR" %}

        '6'    

{%else%}

        '1'    

{%/if%}

}}

 

The idea is to use the executionMetadata function, but with its value being a condition based on a field from a dataset.

The error message is: Invalid syntax found: '{'. Error beginning at position: Line 1, Character 40

How can I resolve this?

Best answer by Anuhya-Y

@Raul_Albuquerq  try this 

{%#if profile._cogna.cogna_student_profile_attributes.DS_ASSINATURA == "PITAGORAS"%}
  {{executionMetadata key="CODIGO" value="2"}}

{%else if profile._cogna.cogna_student_profile_attributes.DS_ASSINATURA == "UNIC"%}
  {{executionMetadata key="CODIGO" value="3"}}

{%else if profile._cogna.cogna_student_profile_attributes.DS_ASSINATURA == "UNIDERP"%}
  {{executionMetadata key="CODIGO" value="4"}}

{%else if profile._cogna.cogna_student_profile_attributes.DS_ASSINATURA == "UNIME"%}
  {{executionMetadata key="CODIGO" value="5"}}

{%else if profile._cogna.cogna_student_profile_attributes.DS_ASSINATURA == "UNOPAR"%}
  {{executionMetadata key="CODIGO" value="6"}}

{%else%}
  {{executionMetadata key="CODIGO" value="1"}}
{%/if%}

2 replies

Anuhya-Y
Community Advisor
Anuhya-YCommunity AdvisorAccepted solution
Community Advisor
February 20, 2026

@Raul_Albuquerq  try this 

{%#if profile._cogna.cogna_student_profile_attributes.DS_ASSINATURA == "PITAGORAS"%}
  {{executionMetadata key="CODIGO" value="2"}}

{%else if profile._cogna.cogna_student_profile_attributes.DS_ASSINATURA == "UNIC"%}
  {{executionMetadata key="CODIGO" value="3"}}

{%else if profile._cogna.cogna_student_profile_attributes.DS_ASSINATURA == "UNIDERP"%}
  {{executionMetadata key="CODIGO" value="4"}}

{%else if profile._cogna.cogna_student_profile_attributes.DS_ASSINATURA == "UNIME"%}
  {{executionMetadata key="CODIGO" value="5"}}

{%else if profile._cogna.cogna_student_profile_attributes.DS_ASSINATURA == "UNOPAR"%}
  {{executionMetadata key="CODIGO" value="6"}}

{%else%}
  {{executionMetadata key="CODIGO" value="1"}}
{%/if%}

Sukrity_Wadhwa
Community Manager
Community Manager
March 2, 2026

Hi ​@Raul_Albuquerq,

Was the given solution by ​@Anuhya-Y helpful to resolve your query or do you still need more help here? Do let us know. In case the given solution was helpful, then kindly choose it as the 'Best Answer'.

Thanks!

Sukrity Wadhwa