Perform a conditional within an HTML | Community
Skip to main content
Level 2
May 5, 2025
Solved

Perform a conditional within an HTML

  • May 5, 2025
  • 2 replies
  • 784 views

Is it possible to perform a conditional within an HTML, using a field from an import entity, as in the example below?

It is showing an error for me.

 

{%#if profile._cogna.audienceEnrichment.CustomerAudienceUpload.2d643823-3861-4897-a603-03806d6d5651.qtd_disciplina = "1"%}
 
This is the error:
 
Invalid syntax Error in parsing PQL expression "profile._cogna.audienceEnrichment.CustomerAudienceUpload.2d643823-3861-4897-a603-03806d6d5651.qtd_disciplina = "1"": line 1:56 mismatched input '.2' expecting {<EOF>, '*', '/', '%', '+', '-', '(', '.', '[', '>', '>=', '<', '<=', '!=', '?:', '=', And, Or, Occurs, In, Like, Matches, 'notIn'}. Error beginning at position: Line 27, Character 8
Best answer by SatheeskannaK

The audience was published, but this was done after the diary evaluate process in the sandbox. So, there is no count on it yet.


@raul_albuquerq Alright. It's still throwing an error. Try with the option "insert with the fallback text" from one of the enrichment attributes; still, it will throw an error. It's not working with the if conditions either.

Refer to the attached screenshot. 

I would suggest opening a support ticket with Adobe.

2 replies

SatheeskannaK
Community Advisor
Community Advisor
May 6, 2025

@raul_albuquerq Looking at the error reference to custom audience upload through CSV throwing error. Validate if there have been any updates to audience upload. If you have the reference correctly it should work like the below after validation,

Thanks, Sathees
Level 2
May 6, 2025

Hi SatheeskannaK!

 

It didn't work. Do you believe that is because the audience is not evaluated yet?

SatheeskannaK
Community Advisor
Community Advisor
May 6, 2025

What's the audience status either processing or published? As long as audience status becomes published you should be able to reference that in the journey and personalization functions.

Thanks, Sathees
AnkitJasani29
Level 6
May 6, 2025

Hi @raul_albuquerq,

I can see you are using = instead of == in your syntax.

Please use like below and try it once

{%#if profile._cogna.audienceEnrichment.CustomerAudienceUpload.2d643823-3861-4897-a603-03806d6d5651.qtd_disciplina == "1"%}

Level 2
May 6, 2025

Hi, AnkitJasani29!

 

It didn't work. Do you believe that is because the audience is not evaluated yer?