watsonx Assistant

 View Only

SpEL in WA, issue with colon

  • 1.  SpEL in WA, issue with colon

    Posted Wed October 09, 2024 10:02 AM
    Edited by KENNY CHUA Wed October 09, 2024 10:04 AM

    Hi, I'm looking for help with Watson Assistant.

    I am calling TRIRIGA OSLC API's. The problem I have is the field names in the response all are prefixed with a namespace. example spi:triNameTX I am trying to use the .joinToArray templating to get it to display multiple result rather than having to hardcode the index one by one. for example: context.space_lookup = context.step_469_result_1.body['rdfs:member'][0]['spi:triNameTX'].

    And my display expression is: context.step_469_result_1.body['rdfs:member'].joinToArray("Space %e.spi:triNameTX%").

    I've tried escaping it context.step_469_result_1.body['rdfs:member'].joinToArray("Space %e.spi\\:triNameTX%") but it turns the entire line into Text. But at least I know .joinToArray works, because I get this: "Space %e.spi\\:triNameTX%Space %e.spi\\:triNameTX%Space %e.spi\\:triNameTX%"

    Does anyone have any ideas on how to change the field name? I know it can't be done in the OPEN API doc, SpEL in WA doesn't take loops or any functions does it? What are my options?

    Thank you!!

    Kenny



    ------------------------------
    KENNY CHUA
    ------------------------------