how to pass array in expression rule

I



I want the result of this expression rule to be in the below format or the highlighted format in the editor. currently I am passing name and comment from one CDT ,now along with this 2 fields  I need to pass the colleagues array with add array with in the colleague array.


I have created other new  CDT for colleague array with id , typeid and addcolleague array in it ,how to call it in the expression rule to get the result in the below format . Please advise



How can I get this result in the below format ,can someone please advise


Expected RESULT

a!toJson

({

"name": "string",
"Comment": "string",

Colleagues:
{

{

"TypeId": 1,
addColleague:

{
"email": "string",
"displayName": "String",
"eFlag": false,
"dFlag": false,
"ProviderID": 2,
"idFromProvider": "string"   }

}

}


})

  Discussion posts and replies are publicly visible

Parents Reply
  • I want this body as input to an integration .In the existing process model we are passing body only with name and comment as an input to an integration via scriptask (input as expressionrule )


    I need to get output of expressionrule as below




    a!toJson
    ({
         "name": " some string from db ",
         "Comment": "some string from db",

          CAC:{
          {

          "TypeId":  1,                    /*Value is always 1*/
         
            add: {
            "email":               "some string from data ",
            "dName" :  "some string from data",
            "Provider"        :  "some string from data",

            "eFlag": false,
            "dFlag": false,
            "ID": 2
             
          }
        }
      }
    })


    name ,comment,email,provider and dname values are present in one CDT  . I'm trying build an array structure and get email and dname  from main CDT where existing values are present.


    1. Have already existing CDT I..e Main CDT ---name ,comment,email,dname and few other fields and now i have added CAC Cdt in this mail CDT as an array

    2. Created One CDT for CAC with fields type ID and add CDT

    3. In ADD CDT , added fields email,name,provider,eflag ,dflag 

    Can you please help because of incorrect looping server got crashes due to memoryheap


Children