Skip to main content
Known Participant
Jul 16, 2021 1:06 PM UTC
Question

How to store HTTP response of an integration to CDT in a process model variable

Hi All,

I have a integration point in process and it is returning HTTP Response.

I would like to know how to convert HTTP Response to CDT .

in HTTP Response there is body attribute which i want to convert directly to CDT if possible.

I have already created a CDT with the same structure.

Example :

body={coord={lon=-83.1801, lat=42.3349}, weather={id=501, main=Rain, description=moderate rain, icon=10d}, base=stations, main={temp=20.35, feels_like=20.84, temp_min=18.83, temp_max=21.73, pressure=1017, humidity=92}, visibility=10000, wind={speed=3.09, deg=80}, rain={1h=1.5}, clouds={all=90}, dt=1626440173, sys={type=2, id=2009516, country=US, sunrise=1626430214, sunset=1626484018}, timezone=-14400, id=0, name=Dearborn, cod=200}

Thanks,

Gaurav

    7 replies

    Known Participant
    Jul 16, 2021 1:10 PM UTC

    i am using convert json to appian value

    madhusudans0001
    Participating Frequently
    Jul 16, 2021 1:19 PM UTC

    You can try casting the body to the CDT or create a new CDT object and assign the values from the body.

    Known Participant
    Jul 16, 2021 1:24 PM UTC

    thanks for your response , so should i use a script task and then do this transformation?

    madhusudans0001
    Participating Frequently
    Jul 16, 2021 1:28 PM UTC

    Yeah, you can call your integration via Script Task or Call Integration Service in the process model and do the conversion.

    peter.lewis
    Employee
    Jul 16, 2021 2:57 PM UTC

    It's usually easiest to do this directly in the Call Integration Smart Service Itself. If you use "AC!Result.body", you can save the results directly to a process variable that uses a CDT list and Appian will cast automatically.

    Known Participant
    Jul 19, 2021 4:01 AM UTC

    Dear [mention:6b9f80ff18f9420082d13ef2d5121d56:e9ed411860ed4f2ba0265705b8793d05], thank you so much for your guidance.

    My bad , not sure why I did not click on + sign and see if I can map individual parameters of Result object. 

    I would like to take this opportunity to thank you for your excellent Appian's Tutorials videos , in last 1 month i have gone through all tutorial videos posted @Appian online course site.

    The way you have explained the concepts are amazing. Great Work [emoticon:1435ff2429184e17bc948e4f19178e1e]!

    Thanks,

    Gaurav

    Participating Frequently
    Apr 17, 2023 5:45 PM UTC

    Can you share how does your CDT look like, I was also having the same issue