Below is the sample input data which is used in lua code
{
“PersonData”: {
“NRIC”: “S8400013K”,
“LoginID”: “SPF457812”,
“Name”: “Name of S8400013K”,
“CategoryType”: “PERM”,
“RankCode”: “01808”,
“TelephoneNumber”: “61239009”,
“MobileNumber”: “61239009”,
“EmailID”: “test1@gmail.com”
},
“RolesType”: {
“Role”: [
{
“RoleID”: “12345”,
“RoleType”: “Administrator Role”
},
{
“RoleID”: “12345”,
“RoleType”: “Administrator Role”
}
]
}
}
As output is JSON file so below is the JSON template which will be used to convert input data.
{
“PersonData”: {
“NRIC”: “”
},
“RolesType”: {
“Role”: [
{
“RoleID”: “”,
“RoleType”: “”
}
]
}
}
So here RoleID and RoleType is in array.
I can receive multiple RoleID and RoleType from input data.
So i need to form json ouput based on input received.
The problem i facing that after parsing json template for the ouput.
Not able to map multiple RoleID and RoleType as json output template has only one.
“Role”: [
{
“RoleID”: “”,
“RoleType”: “”
}
]
So how can i map incoming multiple array values ?
Appreciate for any help