Skip to main content
Participant
May 24, 2023
Question

jsonata : complexe expression not working?

  • May 24, 2023
  • 1 reply
  • 429 views

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 has been closed for replies.

    1 reply

    Adobe Employee
    May 26, 2023

    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.

    Participant
    May 26, 2023

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