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

Execution Metadata Function with a condition

  • February 19, 2026
  • 1 reply
  • 8 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?

1 reply

Anuhya-Y
Community Advisor
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%}