This topic contains 0 replies, has 1 voice, and was last updated by  pooja 6 months, 4 weeks ago.

Read JSON and convert to JSON format

  • Hi,

    Below is the sample data(json input file)

    {

    “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”
    }
    ]
    }
    }

    So i have to read the data and convert into below Json template format

    Json Template:
    {

    “PersonData”: {
    “NRIC”: “”

    },

    “RolesType”: {
    “Role”: [
    {
    “RoleID”: “”,
    “RoleType”: “”
    }
    ]
    }
    }

    So how should i map incoming sample data to JSON template?

    As incoming sample data may contain multiple value for ROLE which is in array format.

    My Json template has only one , so how i can create output with provided Json template as incoming data may contain multiple value for ROLE.

    Thanks in advance for your help.

You must be logged in to reply to this topic.