Get Data From Json and Save Into a Variable

Hi All,

I was able to get the data from external System with a!httpQuery and using a!fromJson() I could able to get the data in the below format.
[{"EMP_ID":1,"EMP_NAME":"ABC","ORG":"VPC","MANAGER_CONTACT_NAME":"My Name"}],
So could someone help me how to save this single text value, into a CDT or basically what I want is the Values for those respective properties.
TIA :)

OriginalPostID-231320

  Discussion posts and replies are publicly visible

Parents
  • @harshav - If you are passing this to a process and the process has variables with same names set as parameters then you only need to do the following, this will extract and map.
    \tprocessParameters: a!fromJson(http!request.body)

    If you need to create a CDT from JSON then use cast function and whichever fields match will be populated.
    local!value: cast(
    \t'type!{urn:com:appian:types:SAN}SAN_Process_Input',
    \ta!fromJson(http!request.body)
    )
Reply
  • @harshav - If you are passing this to a process and the process has variables with same names set as parameters then you only need to do the following, this will extract and map.
    \tprocessParameters: a!fromJson(http!request.body)

    If you need to create a CDT from JSON then use cast function and whichever fields match will be populated.
    local!value: cast(
    \t'type!{urn:com:appian:types:SAN}SAN_Process_Input',
    \ta!fromJson(http!request.body)
    )
Children
No Data