Need to Convert the values into specific Json Format

Certified Associate Developer

Hello All,

 

I have a requirement to convert a CDT value into specific Json Format, Here is the scenario

 

Suppose there is variable called "initialCDT", Such as

 

local!initalCDT:{

{

type!abc(

Key:"NoOfPages",

Value:{1,2,3}

},

{

type!abc{

Key:"WordCount",

Value:{5,6,7}

}

}

 

Now I have some other variables as well holding some values but the the above variable can have dynamic number of Key Value pairs. So My requirement is to create a Json String like below

{

"Title":"Journey to West",

"StartDate":"2018-10-08",

"EndDate":2018-12-08",

"ProcessParameters":{

       "NoOfPages":{1,2,3},

       "WordCount":{5,6,7}

}

},

 

Here the ProcessParameter is made from the variable declared above and the format should be exactly the same, Otherwise the API method will  fail, Can someone please assist me here? Thanks in advance

  Discussion posts and replies are publicly visible