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
  • 0
    Certified Associate Developer

    Hi Harsh,
    If you are using in uesr interface
    then take
    local!data: a!fromjson([{"EMP_ID":1,"EMP_NAME":"ABC","ORG":"VPC","MANAGER_CONTACT_NAME":"My Name"}]),

    then for each field use
    local!empId = index(local!data,"EMP_ID",null)

    if you need all values map to CDT then
    type!respective CDT (ex:Emp-Data)(

    empId:index(local!data,"EMP_ID",null),

    empNmae:index(local!data,"EMP_NAME",null)...etc

    )

Reply
  • 0
    Certified Associate Developer

    Hi Harsh,
    If you are using in uesr interface
    then take
    local!data: a!fromjson([{"EMP_ID":1,"EMP_NAME":"ABC","ORG":"VPC","MANAGER_CONTACT_NAME":"My Name"}]),

    then for each field use
    local!empId = index(local!data,"EMP_ID",null)

    if you need all values map to CDT then
    type!respective CDT (ex:Emp-Data)(

    empId:index(local!data,"EMP_ID",null),

    empNmae:index(local!data,"EMP_NAME",null)...etc

    )

Children
No Data