API Connect

API Connect

Join this online group to communicate across IBM product users and experts by sharing advice and best practices with peers and staying up to date regarding product enhancements.


#API Connect
#Applicationintegration
#APIConnect
 View Only
  • 1.  extract policy not working as expected

    Posted 09/08/23 08:38 AM

    As per IBM documentation on extract policy in IBM APIC, I used the below code within th extract policy 

    • I am trying to change the Name filed value with my json to uppercase using the extract policy. But I see no changes at all. Below is the snippet of the property settings within the extract policy and also how the sample json message looks like

    Sample json which I'm trying to convert is:



    ------------------------------
    Radhika Tharayil
    ------------------------------


  • 2.  RE: extract policy not working as expected

    Posted 09/08/23 09:16 AM
    Edited by Steve Linn 09/08/23 09:25 AM

    Hi Radhika,
    Since your root is message.body, the Capture is relative to that part of the context.   I specified as the Capture $.Details.Name, and the transform as simply $uppercase($) where $ is the data represented by the Capture.
    My result

    {"Details":{"Name":"STEVE"}}

    I also specified as my Capture $.Details."Name" which also worked, although it isn't necessary to put the Name property in quotes.

    In your case you already have the root as message.body and then in your transform also specify message.body so that is one reason yours is not working. In my testing, if the capture is just $ then you have the entire message.body available to the transform, but when I specified $.Details."Name" in the transform it didn't work until I removed the quotations.  That may be a product issue although as noted, the quotations are not necessary.
    Best Regards,
    Steve



    ------------------------------
    Steve Linn
    Senior Consulting I/T Specialist
    IBM
    ------------------------------