Skip to main content
Participant
May 24, 2023 7:26 PM UTC
Question

jsonata : complexe expression not working?

Hi,

 

I tried theses expressions, but nothing display

  1. {{$join(specificRequest.certificationCategory)}}
  2. {% conditional-section expr(specificRequest.certificationCategory != null) %}Non{% end-section %}
  3. {% conditional-section expr(“FORMATION_ACTIONS” in specificRequest.certificationCategory) %}has FA{% end-section %}
  4. {% conditional-section expr($contains($join(specificRequest.certificationCategory), “COMPETENCE_ASSESSMENT”)) %}tototoot {% end-section %}
  5. {{expr($count(specificRequest.certificationCategory))}}

 

The first displays:

FORMATION_ACTIONSCOMPETENCE_ASSESSMENTEXPERIENCE_ACQUISITION_ACTIONSLEARNING_ACTIONS

The second displays the text correctly

The third and fourth display nothing

The last displays 4

 

The json looks like that, and everythongs works on jsonata.

{
"specificRequest": {
    "certificationCategory": ["FORMATION_ACTIONS", "COMPETENCE_ASSESSMENT"]
}
}
    This topic is closed to new replies. Start a new post to keep the conversation going.

    2 replies

    Adobe Employee
    May 26, 2023 6:52 AM UTC

    Hi @Stephane29154717bl5j,

    I've tried out the template with the json data you've provided. 

    • For 1,5 I think you might've used a different json which contains four entries while generating the output.
    • For 2,3 please use normal double quotes(") instead of specials double quotes(“).

    Please let us know if you have any more doubts.

    Translate
    Participant
    May 26, 2023 6:59 AM UTC

    Thanks, I'l succeed getting all working using computing moore stuff in my backend.
    I provide more boolean to my template. It works.

    Translate