I have a nested list dictionary. I need to sort the list(Upper-level list) by inner dictionary when it is matching the label and by value in python. For example, I want to sort the list where ("label"=="Name" and by value of the key "value" of the inner dictionary), Here is my dictionary,
[
[
{
"propertyId": 1,
"fieldName": "Name",
"value": "mahir contact 1",
"objectTypeName": "Contact properties",
"groupName": "Contact information",
"name": "name",
"label": "Name",
"description": "default properties by roboket",
"fieldType": "Single line text",
"fieldDataType": "string",
"propertyOwnerId": null,
"propertyOwnerAccountId": 1,
"default": true,
"hasOptions": false,
"id": 1,
"contactCreatorId": 1,
"contactOwnerId": 1,
"createdAt": "2020-11-24T05:57:01.248107"
},
{
"propertyId": 2,
"fieldName": "Email",
"value": "[email protected]",
"objectTypeName": "Contact properties",
"groupName": "Contact information",
"name": "email",
"label": "Email",
"description": "default properties by roboket",
"fieldType": "Single line text",
"fieldDataType": "email",
"propertyOwnerId": null,
"propertyOwnerAccountId": 1,
"default": true,
"hasOptions": false,
"id": 1,
"contactCreatorId": 1,
"contactOwnerId": 1,
"createdAt": "2020-11-24T05:57:01.253318"
},
{
"propertyId": 6,
"fieldName": "Contact creation date",
"value": "2020-11-24 05:57:01.216359",
"objectTypeName": "Contact properties",
"groupName": "Contact information",
"name": "contactCreationDate",
"label": "Contact creation date",
"description": "default properties by roboket",
"fieldType": "Date picker",
"fieldDataType": "datetime",
"propertyOwnerId": null,
"propertyOwnerAccountId": 1,
"default": false,
"hasOptions": false,
"id": 1,
"contactCreatorId": 1,
"contactOwnerId": 1,
"createdAt": "2020-11-24T05:57:01.256631"
},
{
"propertyId": 11,
"fieldName": "Contact owner",
"value": "1",
"objectTypeName": "Contact properties",
"groupName": "Contact information",
"name": "contactOwner",
"label": "Contact owner",
"description": "default properties by roboket",
"fieldType": "Dropdown select",
"fieldDataType": "select",
"propertyOwnerId": null,
"propertyOwnerAccountId": 1,
"default": true,
"hasOptions": true,
"id": 1,
"contactCreatorId": 1,
"contactOwnerId": 1,
"createdAt": "2020-11-24T05:57:01.261312"
}
],
[
{
"propertyId": 3,
"fieldName": "Phone number",
"value": "+8801517179498",
"objectTypeName": "Contact properties",
"groupName": "Contact information",
"name": "phoneNumber",
"label": "Phone number",
"description": "default properties by roboket",
"fieldType": "Single line text",
"fieldDataType": "number",
"propertyOwnerId": null,
"propertyOwnerAccountId": 1,
"default": true,
"hasOptions": false,
"id": 2,
"contactCreatorId": 1,
"contactOwnerId": 1,
"createdAt": "2020-11-24T05:58:04.115570"
},
{
"propertyId": 6,
"fieldName": "Contact creation date",
"value": "2020-11-24 05:58:04.070069",
"objectTypeName": "Contact properties",
"groupName": "Contact information",
"name": "contactCreationDate",
"label": "Contact creation date",
"description": "default properties by roboket",
"fieldType": "Date picker",
"fieldDataType": "datetime",
"propertyOwnerId": null,
"propertyOwnerAccountId": 1,
"default": false,
"hasOptions": false,
"id": 2,
"contactCreatorId": 1,
"contactOwnerId": 1,
"createdAt": "2020-11-24T05:58:04.122804"
},
{
"propertyId": 11,
"fieldName": "Contact owner",
"value": "1",
"objectTypeName": "Contact properties",
"groupName": "Contact information",
"name": "contactOwner",
"label": "Contact owner",
"description": "default properties by roboket",
"fieldType": "Dropdown select",
"fieldDataType": "select",
"propertyOwnerId": null,
"propertyOwnerAccountId": 1,
"default": true,
"hasOptions": true,
"id": 2,
"contactCreatorId": 1,
"contactOwnerId": 1,
"createdAt": "2020-11-24T05:58:04.130811"
},
{
"propertyId": 1,
"fieldName": "Name",
"value": "mahir contact 2",
"objectTypeName": "Contact properties",
"groupName": "Contact information",
"name": "name",
"label": "Name",
"description": "default properties by roboket",
"fieldType": "Single line text",
"fieldDataType": "string",
"propertyOwnerId": null,
"propertyOwnerAccountId": 1,
"default": true,
"hasOptions": false,
"id": 2,
"contactCreatorId": 1,
"contactOwnerId": 1,
"createdAt": "2020-11-24T05:58:04.111468"
}
]
]
My Expected Output:
[
[
{
"propertyId": 3,
"fieldName": "Phone number",
"value": "+8801517179498",
"objectTypeName": "Contact properties",
"groupName": "Contact information",
"name": "phoneNumber",
"label": "Phone number",
"description": "default properties by roboket",
"fieldType": "Single line text",
"fieldDataType": "number",
"propertyOwnerId": null,
"propertyOwnerAccountId": 1,
"default": true,
"hasOptions": false,
"id": 2,
"contactCreatorId": 1,
"contactOwnerId": 1,
"createdAt": "2020-11-24T05:58:04.115570"
},
{
"propertyId": 6,
"fieldName": "Contact creation date",
"value": "2020-11-24 05:58:04.070069",
"objectTypeName": "Contact properties",
"groupName": "Contact information",
"name": "contactCreationDate",
"label": "Contact creation date",
"description": "default properties by roboket",
"fieldType": "Date picker",
"fieldDataType": "datetime",
"propertyOwnerId": null,
"propertyOwnerAccountId": 1,
"default": false,
"hasOptions": false,
"id": 2,
"contactCreatorId": 1,
"contactOwnerId": 1,
"createdAt": "2020-11-24T05:58:04.122804"
},
{
"propertyId": 11,
"fieldName": "Contact owner",
"value": "1",
"objectTypeName": "Contact properties",
"groupName": "Contact information",
"name": "contactOwner",
"label": "Contact owner",
"description": "default properties by roboket",
"fieldType": "Dropdown select",
"fieldDataType": "select",
"propertyOwnerId": null,
"propertyOwnerAccountId": 1,
"default": true,
"hasOptions": true,
"id": 2,
"contactCreatorId": 1,
"contactOwnerId": 1,
"createdAt": "2020-11-24T05:58:04.130811"
},
{
"propertyId": 1,
"fieldName": "Name",
"value": "mahir contact 2",
"objectTypeName": "Contact properties",
"groupName": "Contact information",
"name": "name",
"label": "Name",
"description": "default properties by roboket",
"fieldType": "Single line text",
"fieldDataType": "string",
"propertyOwnerId": null,
"propertyOwnerAccountId": 1,
"default": true,
"hasOptions": false,
"id": 2,
"contactCreatorId": 1,
"contactOwnerId": 1,
"createdAt": "2020-11-24T05:58:04.111468"
}
],
[
{
"propertyId": 1,
"fieldName": "Name",
"value": "mahir contact 1",
"objectTypeName": "Contact properties",
"groupName": "Contact information",
"name": "name",
"label": "Name",
"description": "default properties by roboket",
"fieldType": "Single line text",
"fieldDataType": "string",
"propertyOwnerId": null,
"propertyOwnerAccountId": 1,
"default": true,
"hasOptions": false,
"id": 1,
"contactCreatorId": 1,
"contactOwnerId": 1,
"createdAt": "2020-11-24T05:57:01.248107"
},
{
"propertyId": 2,
"fieldName": "Email",
"value": "[email protected]",
"objectTypeName": "Contact properties",
"groupName": "Contact information",
"name": "email",
"label": "Email",
"description": "default properties by roboket",
"fieldType": "Single line text",
"fieldDataType": "email",
"propertyOwnerId": null,
"propertyOwnerAccountId": 1,
"default": true,
"hasOptions": false,
"id": 1,
"contactCreatorId": 1,
"contactOwnerId": 1,
"createdAt": "2020-11-24T05:57:01.253318"
},
{
"propertyId": 6,
"fieldName": "Contact creation date",
"value": "2020-11-24 05:57:01.216359",
"objectTypeName": "Contact properties",
"groupName": "Contact information",
"name": "contactCreationDate",
"label": "Contact creation date",
"description": "default properties by roboket",
"fieldType": "Date picker",
"fieldDataType": "datetime",
"propertyOwnerId": null,
"propertyOwnerAccountId": 1,
"default": false,
"hasOptions": false,
"id": 1,
"contactCreatorId": 1,
"contactOwnerId": 1,
"createdAt": "2020-11-24T05:57:01.256631"
},
{
"propertyId": 11,
"fieldName": "Contact owner",
"value": "1",
"objectTypeName": "Contact properties",
"groupName": "Contact information",
"name": "contactOwner",
"label": "Contact owner",
"description": "default properties by roboket",
"fieldType": "Dropdown select",
"fieldDataType": "select",
"propertyOwnerId": null,
"propertyOwnerAccountId": 1,
"default": true,
"hasOptions": true,
"id": 1,
"contactCreatorId": 1,
"contactOwnerId": 1,
"createdAt": "2020-11-24T05:57:01.261312"
}
]
]
Advance thanks for your help.