API Connect

 View Only
  • 1.  Switch policy conditions

    Posted Wed April 06, 2022 04:24 PM
    Hi All,
    We are creating switching logic based on request parameters and response headers, I am using exists() function available on the switch policy. exists function with request parameter is working fine. the condition matches correctly and flow is getting executed, however the same is not working when the condition is checking for the existence of the response header which is message context.  I would like to know if there is any limitation on using message context in switch conditions or if I am doing something wrong. 

    We are using DP API Gateway v10.0.1.6

    Screenshot of request parameter condition

    Screenshot of message headers

    Please provide your input.

    Arjun Pilli
    API Specialist
    +27 0840611655

  • 2.  RE: Switch policy conditions

    Posted Thu April 07, 2022 08:41 AM
    Edited by Steve Linn Thu April 07, 2022 08:41 AM

    Hi Arjun,
    I just ran into this myself the other day :-)  If a part of the JSONata path has a hyphen, it has to be enclosed in back quotes.  Without the back quotes, it is treating the hyphen as a mathematical minus operator. Try




    Steve Linn
    Senior Consulting I/T Specialist

  • 3.  RE: Switch policy conditions

    Posted Thu April 07, 2022 10:37 AM

    Thank you Steve.


    It works like a charm. Thanks again for you input.


    Best regards,
    Arjun Pilli, External, API Specialist

    EXT.Arjun.Pilli@dsv.com  |  Office +27 102480076  |  Mobile +27 0840611655  |  www.dsv.com