Need to maintain a specific order while converting JSON to Excel

Hi ,
I am converting JSON data to Aspose using

aspose.cells.JsonUtility.importData(
        JSON.stringify(finalJsonData),
        worksheet.getCells(),
        0,
        0,
        layoutOptions
    );

sample finalJsonData = [
{

‘name’: ‘dummy1’,
‘age’: ‘20’,
‘address_2_country’: ‘US’,
‘address_2_pincode’: ‘12345’,
‘address_1_country’: ‘UK’,
‘address_1_pincode’: ‘28475’
},
{
‘name’: ‘dummy2’,
‘age’: ‘22’,
‘address_2_country’: ‘UK’,
‘address_2_pincode’: ‘12345’,
‘address_1_country’: ‘US’,
‘address_1_pincode’: ‘12345’
}
]

columnOrder = [‘name’,‘age’,‘address_1_pincode’,‘address_2_pincode’,‘address_1_country’,‘address_2_country’]

Final Column headers in EXCEL should be as mentioned below
‘name’ , ‘age’ , ‘address_1_pincode’ , ‘address_2_pincode’ , ‘address_1_country’ , ‘address_2_country’

Here , I need to get the excel column headers which are mentioned in the above column Order, is there a possibility to achieve that ??

Thanks

@Veerendra1234,

I think you may set/define your desired order for data in JSON, so you could get your desired results when importing JSON to Excel.

you can change the order of the columns using the Cells.InsertCutCells method.
You can refer to the following documentation for more information on how to cut and paste cells: Cut and Paste Ranges|Documentation