无法在具有重复键的深层嵌套数组中找到 jsonpath
Unable to find jsonpath in deeply nested array with duplicate keys
我有一个深度嵌套的 json 如下:
[
[
{
"heading": "Account Information",
"columns": 2,
"id": "01B5g000015Z7yeEAC",
"rows": 8,
"collapsible": false,
"useHeading": false,
"layoutRows": [
{
"layoutItems": [
{
"editableForUpdate": false,
"editableForNew": true,
"layoutComponents": [
{
"componentType": "Field",
"apiName": "Rating",
"label": "Account Rating"
}
],
"label": "Rating",
"lookupIdApiName": null,
"sortable": false,
"required": false
}
]
},
{
"layoutItems": [
{
"editableForUpdate": true,
"editableForNew": true,
"layoutComponents": [
{
"componentType": "Field",
"apiName": "Name",
"label": "Account Name"
}
],
"label": "Account Name",
"lookupIdApiName": "Id",
"sortable": false,
"required": true
},
{
"editableForUpdate": true,
"editableForNew": true,
"layoutComponents": [
{
"componentType": "Field",
"apiName": "Phone",
"label": "Account Phone"
}
],
"label": "Phone",
"lookupIdApiName": null,
"sortable": false,
"required": false
}
]
},
{
"layoutItems": [
{
"editableForUpdate": true,
"editableForNew": true,
"layoutComponents": [
{
"componentType": "Field",
"apiName": "ParentId",
"label": "Parent Account ID"
}
],
"label": "Parent Account",
"lookupIdApiName": "ParentId",
"sortable": false,
"required": false
},
{
"editableForUpdate": true,
"editableForNew": true,
"layoutComponents": [
{
"componentType": "Field",
"apiName": "Fax",
"label": "Account Fax"
}
],
"label": "Fax",
"lookupIdApiName": null,
"sortable": false,
"required": false
}
]
},
{
"layoutItems": [
{
"editableForUpdate": true,
"editableForNew": true,
"layoutComponents": [
{
"componentType": "Field",
"apiName": "AccountNumber",
"label": "Account Number"
}
],
"label": "Account Number",
"lookupIdApiName": null,
"sortable": false,
"required": false
},
{
"editableForUpdate": true,
"editableForNew": true,
"layoutComponents": [
{
"componentType": "Field",
"apiName": "Website",
"label": "Website"
}
],
"label": "Website",
"lookupIdApiName": null,
"sortable": false,
"required": false
}
]
},
{
"layoutItems": [
{
"editableForUpdate": true,
"editableForNew": true,
"layoutComponents": [
{
"componentType": "Field",
"apiName": "Site",
"label": "Account Site"
}
],
"label": "Account Site",
"lookupIdApiName": null,
"sortable": false,
"required": false
},
{
"editableForUpdate": true,
"editableForNew": true,
"layoutComponents": [
{
"componentType": "Field",
"apiName": "TickerSymbol",
"label": "Ticker Symbol"
}
],
"label": "Ticker Symbol",
"lookupIdApiName": null,
"sortable": false,
"required": false
}
]
},
{
"layoutItems": [
{
"editableForUpdate": true,
"editableForNew": true,
"layoutComponents": [
{
"componentType": "Field",
"apiName": "Type",
"label": "Account Type"
}
],
"label": "Type",
"lookupIdApiName": null,
"sortable": false,
"required": false
},
{
"editableForUpdate": true,
"editableForNew": true,
"layoutComponents": [
{
"componentType": "Field",
"apiName": "Ownership",
"label": "Ownership"
}
],
"label": "Ownership",
"lookupIdApiName": null,
"sortable": false,
"required": false
}
]
},
{
"layoutItems": [
{
"editableForUpdate": true,
"editableForNew": true,
"layoutComponents": [
{
"componentType": "Field",
"apiName": "Industry",
"label": "Industry"
}
],
"label": "Industry",
"lookupIdApiName": null,
"sortable": false,
"required": false
},
{
"editableForUpdate": true,
"editableForNew": true,
"layoutComponents": [
{
"componentType": "Field",
"apiName": "NumberOfEmployees",
"label": "Employees"
}
],
"label": "Employees",
"lookupIdApiName": null,
"sortable": false,
"required": false
}
]
},
{
"layoutItems": [
{
"editableForUpdate": true,
"editableForNew": true,
"layoutComponents": [
{
"componentType": "Field",
"apiName": "AnnualRevenue",
"label": "Annual Revenue"
}
],
"label": "Annual Revenue",
"lookupIdApiName": null,
"sortable": false,
"required": false
},
{
"editableForUpdate": true,
"editableForNew": true,
"layoutComponents": [
{
"componentType": "Field",
"apiName": "Sic",
"label": "SIC Code"
}
],
"label": "SIC Code",
"lookupIdApiName": null,
"sortable": false,
"required": false
}
]
}
]
},
{
"heading": "Address Information",
"columns": 2,
"id": "01B5g000015Z7yhEAC",
"rows": 1,
"collapsible": false,
"useHeading": false,
"layoutRows": [
{
"layoutItems": [
{
"editableForUpdate": true,
"editableForNew": true,
"layoutComponents": [
{
"componentType": "Field",
"apiName": "BillingStreet",
"label": "Billing Street"
},
{
"componentType": "Field",
"apiName": "BillingCity",
"label": "Billing City"
},
{
"componentType": "Field",
"apiName": "BillingState",
"label": "Billing State/Province"
},
{
"componentType": "Field",
"apiName": "BillingPostalCode",
"label": "Billing Zip/Postal Code"
},
{
"componentType": "Field",
"apiName": "BillingCountry",
"label": "Billing Country"
}
],
"label": "Billing Address",
"lookupIdApiName": null,
"sortable": false,
"required": false
},
{
"editableForUpdate": true,
"editableForNew": true,
"layoutComponents": [
{
"componentType": "Field",
"apiName": "ShippingStreet",
"label": "Shipping Street"
},
{
"componentType": "Field",
"apiName": "ShippingCity",
"label": "Shipping City"
},
{
"componentType": "Field",
"apiName": "ShippingState",
"label": "Shipping State/Province"
},
{
"componentType": "Field",
"apiName": "ShippingPostalCode",
"label": "Shipping Zip/Postal Code"
},
{
"componentType": "Field",
"apiName": "ShippingCountry",
"label": "Shipping Country"
}
],
"label": "Shipping Address",
"lookupIdApiName": null,
"sortable": false,
"required": false
}
]
}
]
},
{
"heading": "Additional Information",
"columns": 2,
"id": "01B5g000015Z7yfEAC",
"rows": 4,
"collapsible": false,
"useHeading": false,
"layoutRows": [
{
"layoutItems": [
{
"editableForUpdate": true,
"editableForNew": true,
"layoutComponents": [
{
"componentType": "Field",
"apiName": "CustomerPriority__c",
"label": "Customer Priority"
}
],
"label": "Customer Priority",
"lookupIdApiName": null,
"sortable": false,
"required": false
},
{
"editableForUpdate": true,
"editableForNew": true,
"layoutComponents": [
{
"componentType": "Field",
"apiName": "SLA__c",
"label": "SLA"
}
],
"label": "SLA",
"lookupIdApiName": null,
"sortable": false,
"required": false
}
]
},
{
"layoutItems": [
{
"editableForUpdate": true,
"editableForNew": true,
"layoutComponents": [
{
"componentType": "Field",
"apiName": "SLAExpirationDate__c",
"label": "SLA Expiration Date"
}
],
"label": "SLA Expiration Date",
"lookupIdApiName": null,
"sortable": false,
"required": false
},
{
"editableForUpdate": true,
"editableForNew": true,
"layoutComponents": [
{
"componentType": "Field",
"apiName": "SLASerialNumber__c",
"label": "SLA Serial Number"
}
],
"label": "SLA Serial Number",
"lookupIdApiName": null,
"sortable": false,
"required": false
}
]
},
{
"layoutItems": [
{
"editableForUpdate": true,
"editableForNew": true,
"layoutComponents": [
{
"componentType": "Field",
"apiName": "NumberofLocations__c",
"label": "Number of Locations"
}
],
"label": "Number of Locations",
"lookupIdApiName": null,
"sortable": false,
"required": false
},
{
"editableForUpdate": true,
"editableForNew": true,
"layoutComponents": [
{
"componentType": "Field",
"apiName": "UpsellOpportunity__c",
"label": "Upsell Opportunity"
}
],
"label": "Upsell Opportunity",
"lookupIdApiName": null,
"sortable": false,
"required": false
}
]
},
{
"layoutItems": [
{
"editableForUpdate": true,
"editableForNew": true,
"layoutComponents": [
{
"componentType": "Field",
"apiName": "Active__c",
"label": "Active"
}
],
"label": "Active",
"lookupIdApiName": null,
"sortable": false,
"required": false
}
]
}
]
},
{
"heading": "System Information",
"columns": 2,
"id": "01B5g000015Z7ygEAC",
"rows": 1,
"collapsible": false,
"useHeading": false,
"layoutRows": [
{
"layoutItems": [
]
}
]
},
{
"heading": "Description Information",
"columns": 1,
"id": "01B5g000015Z7yiEAC",
"rows": 1,
"collapsible": false,
"useHeading": false,
"layoutRows": [
{
"layoutItems": [
{
"editableForUpdate": true,
"editableForNew": true,
"layoutComponents": [
{
"componentType": "Field",
"apiName": "Description",
"label": "Account Description"
}
],
"label": "Description",
"lookupIdApiName": null,
"sortable": false,
"required": false
}
]
}
]
},
{
"heading": "Custom Links",
"columns": 3,
"id": "01B5g000015Z7ydEAC",
"rows": 1,
"collapsible": false,
"useHeading": false,
"layoutRows": [
{
"layoutItems": [
]
}
]
}
],
[
{
"heading": "Account Information",
"columns": 2,
"id": "01B5g000015Z7yeEAC",
"rows": 8,
"collapsible": false,
"useHeading": false,
"layoutRows": [
{
"layoutItems": [
{
"editableForUpdate": true,
"editableForNew": true,
"layoutComponents": [
{
"componentType": "Field",
"apiName": "Rating",
"label": "Account Rating"
}
],
"label": "Rating",
"lookupIdApiName": null,
"sortable": false,
"required": false
}
]
},
{
"layoutItems": [
{
"editableForUpdate": true,
"editableForNew": true,
"layoutComponents": [
{
"componentType": "Field",
"apiName": "Name",
"label": "Account Name"
}
],
"label": "Account Name",
"lookupIdApiName": "Id",
"sortable": false,
"required": true
},
{
"editableForUpdate": true,
"editableForNew": true,
"layoutComponents": [
{
"componentType": "Field",
"apiName": "Phone",
"label": "Account Phone"
}
],
"label": "Phone",
"lookupIdApiName": null,
"sortable": false,
"required": false
}
]
},
{
"layoutItems": [
{
"editableForUpdate": true,
"editableForNew": true,
"layoutComponents": [
{
"componentType": "Field",
"apiName": "ParentId",
"label": "Parent Account ID"
}
],
"label": "Parent Account",
"lookupIdApiName": "ParentId",
"sortable": false,
"required": false
},
{
"editableForUpdate": true,
"editableForNew": true,
"layoutComponents": [
{
"componentType": "Field",
"apiName": "Fax",
"label": "Account Fax"
}
],
"label": "Fax",
"lookupIdApiName": null,
"sortable": false,
"required": false
}
]
},
{
"layoutItems": [
{
"editableForUpdate": true,
"editableForNew": true,
"layoutComponents": [
{
"componentType": "Field",
"apiName": "AccountNumber",
"label": "Account Number"
}
],
"label": "Account Number",
"lookupIdApiName": null,
"sortable": false,
"required": false
},
{
"editableForUpdate": true,
"editableForNew": true,
"layoutComponents": [
{
"componentType": "Field",
"apiName": "Website",
"label": "Website"
}
],
"label": "Website",
"lookupIdApiName": null,
"sortable": false,
"required": false
}
]
},
{
"layoutItems": [
{
"editableForUpdate": true,
"editableForNew": true,
"layoutComponents": [
{
"componentType": "Field",
"apiName": "Site",
"label": "Account Site"
}
],
"label": "Account Site",
"lookupIdApiName": null,
"sortable": false,
"required": false
},
{
"editableForUpdate": true,
"editableForNew": true,
"layoutComponents": [
{
"componentType": "Field",
"apiName": "TickerSymbol",
"label": "Ticker Symbol"
}
],
"label": "Ticker Symbol",
"lookupIdApiName": null,
"sortable": false,
"required": false
}
]
},
{
"layoutItems": [
{
"editableForUpdate": true,
"editableForNew": true,
"layoutComponents": [
{
"componentType": "Field",
"apiName": "Type",
"label": "Account Type"
}
],
"label": "Type",
"lookupIdApiName": null,
"sortable": false,
"required": false
},
{
"editableForUpdate": true,
"editableForNew": true,
"layoutComponents": [
{
"componentType": "Field",
"apiName": "Ownership",
"label": "Ownership"
}
],
"label": "Ownership",
"lookupIdApiName": null,
"sortable": false,
"required": false
}
]
},
{
"layoutItems": [
{
"editableForUpdate": true,
"editableForNew": true,
"layoutComponents": [
{
"componentType": "Field",
"apiName": "Industry",
"label": "Industry"
}
],
"label": "Industry",
"lookupIdApiName": null,
"sortable": false,
"required": false
},
{
"editableForUpdate": true,
"editableForNew": true,
"layoutComponents": [
{
"componentType": "Field",
"apiName": "NumberOfEmployees",
"label": "Employees"
}
],
"label": "Employees",
"lookupIdApiName": null,
"sortable": false,
"required": false
}
]
},
{
"layoutItems": [
{
"editableForUpdate": true,
"editableForNew": true,
"layoutComponents": [
{
"componentType": "Field",
"apiName": "AnnualRevenue",
"label": "Annual Revenue"
}
],
"label": "Annual Revenue",
"lookupIdApiName": null,
"sortable": false,
"required": false
},
{
"editableForUpdate": true,
"editableForNew": true,
"layoutComponents": [
{
"componentType": "Field",
"apiName": "Sic",
"label": "SIC Code"
}
],
"label": "SIC Code",
"lookupIdApiName": null,
"sortable": false,
"required": false
}
]
}
]
},
{
"heading": "Address Information",
"columns": 2,
"id": "01B5g000015Z7yhEAC",
"rows": 1,
"collapsible": false,
"useHeading": false,
"layoutRows": [
{
"layoutItems": [
{
"editableForUpdate": true,
"editableForNew": true,
"layoutComponents": [
{
"componentType": "Field",
"apiName": "BillingStreet",
"label": "Billing Street"
},
{
"componentType": "Field",
"apiName": "BillingCity",
"label": "Billing City"
},
{
"componentType": "Field",
"apiName": "BillingState",
"label": "Billing State/Province"
},
{
"componentType": "Field",
"apiName": "BillingPostalCode",
"label": "Billing Zip/Postal Code"
},
{
"componentType": "Field",
"apiName": "BillingCountry",
"label": "Billing Country"
}
],
"label": "Billing Address",
"lookupIdApiName": null,
"sortable": false,
"required": false
},
{
"editableForUpdate": true,
"editableForNew": true,
"layoutComponents": [
{
"componentType": "Field",
"apiName": "ShippingStreet",
"label": "Shipping Street"
},
{
"componentType": "Field",
"apiName": "ShippingCity",
"label": "Shipping City"
},
{
"componentType": "Field",
"apiName": "ShippingState",
"label": "Shipping State/Province"
},
{
"componentType": "Field",
"apiName": "ShippingPostalCode",
"label": "Shipping Zip/Postal Code"
},
{
"componentType": "Field",
"apiName": "ShippingCountry",
"label": "Shipping Country"
}
],
"label": "Shipping Address",
"lookupIdApiName": null,
"sortable": false,
"required": false
}
]
}
]
},
{
"heading": "Additional Information",
"columns": 2,
"id": "01B5g000015Z7yfEAC",
"rows": 4,
"collapsible": false,
"useHeading": false,
"layoutRows": [
{
"layoutItems": [
{
"editableForUpdate": true,
"editableForNew": true,
"layoutComponents": [
{
"componentType": "Field",
"apiName": "CustomerPriority__c",
"label": "Customer Priority"
}
],
"label": "Customer Priority",
"lookupIdApiName": null,
"sortable": false,
"required": false
},
{
"editableForUpdate": true,
"editableForNew": true,
"layoutComponents": [
{
"componentType": "Field",
"apiName": "SLA__c",
"label": "SLA"
}
],
"label": "SLA",
"lookupIdApiName": null,
"sortable": false,
"required": false
}
]
},
{
"layoutItems": [
{
"editableForUpdate": true,
"editableForNew": true,
"layoutComponents": [
{
"componentType": "Field",
"apiName": "SLAExpirationDate__c",
"label": "SLA Expiration Date"
}
],
"label": "SLA Expiration Date",
"lookupIdApiName": null,
"sortable": false,
"required": false
},
{
"editableForUpdate": true,
"editableForNew": true,
"layoutComponents": [
{
"componentType": "Field",
"apiName": "SLASerialNumber__c",
"label": "SLA Serial Number"
}
],
"label": "SLA Serial Number",
"lookupIdApiName": null,
"sortable": false,
"required": false
}
]
},
{
"layoutItems": [
{
"editableForUpdate": true,
"editableForNew": true,
"layoutComponents": [
{
"componentType": "Field",
"apiName": "NumberofLocations__c",
"label": "Number of Locations"
}
],
"label": "Number of Locations",
"lookupIdApiName": null,
"sortable": false,
"required": false
},
{
"editableForUpdate": true,
"editableForNew": true,
"layoutComponents": [
{
"componentType": "Field",
"apiName": "UpsellOpportunity__c",
"label": "Upsell Opportunity"
}
],
"label": "Upsell Opportunity",
"lookupIdApiName": null,
"sortable": false,
"required": false
}
]
},
{
"layoutItems": [
{
"editableForUpdate": true,
"editableForNew": true,
"layoutComponents": [
{
"componentType": "Field",
"apiName": "Active__c",
"label": "Active"
}
],
"label": "Active",
"lookupIdApiName": null,
"sortable": false,
"required": false
}
]
}
]
},
{
"heading": "System Information",
"columns": 2,
"id": "01B5g000015Z7ygEAC",
"rows": 1,
"collapsible": false,
"useHeading": false,
"layoutRows": [
{
"layoutItems": [
]
}
]
},
{
"heading": "Description Information",
"columns": 1,
"id": "01B5g000015Z7yiEAC",
"rows": 1,
"collapsible": false,
"useHeading": false,
"layoutRows": [
{
"layoutItems": [
{
"editableForUpdate": true,
"editableForNew": true,
"layoutComponents": [
{
"componentType": "Field",
"apiName": "Description",
"label": "Account Description"
}
],
"label": "Description",
"lookupIdApiName": null,
"sortable": false,
"required": false
}
]
}
]
},
{
"heading": "Custom Links",
"columns": 3,
"id": "01B5g000015Z7ydEAC",
"rows": 1,
"collapsible": false,
"useHeading": false,
"layoutRows": [
{
"layoutItems": [
]
}
]
}
]
]
我需要所有具有 editableForUpdate 的标签的值为 true :
我试过 JSONpath 作为 $..layoutRows.[?(@.editableForUpdate == true)])].label 但它没有提供所需的标签值和给出重复值。
你能帮我写出正确的 JSONPATH 表达式吗?
试试下面的 JSONPath
$..layoutItems[?(@.editableForUpdate == true)].layoutComponents[*].label
Jayway JSONPath (A Java DSL) : https://jsonpath.herokuapp.com/
的在线工具
我有一个深度嵌套的 json 如下:
[
[
{
"heading": "Account Information",
"columns": 2,
"id": "01B5g000015Z7yeEAC",
"rows": 8,
"collapsible": false,
"useHeading": false,
"layoutRows": [
{
"layoutItems": [
{
"editableForUpdate": false,
"editableForNew": true,
"layoutComponents": [
{
"componentType": "Field",
"apiName": "Rating",
"label": "Account Rating"
}
],
"label": "Rating",
"lookupIdApiName": null,
"sortable": false,
"required": false
}
]
},
{
"layoutItems": [
{
"editableForUpdate": true,
"editableForNew": true,
"layoutComponents": [
{
"componentType": "Field",
"apiName": "Name",
"label": "Account Name"
}
],
"label": "Account Name",
"lookupIdApiName": "Id",
"sortable": false,
"required": true
},
{
"editableForUpdate": true,
"editableForNew": true,
"layoutComponents": [
{
"componentType": "Field",
"apiName": "Phone",
"label": "Account Phone"
}
],
"label": "Phone",
"lookupIdApiName": null,
"sortable": false,
"required": false
}
]
},
{
"layoutItems": [
{
"editableForUpdate": true,
"editableForNew": true,
"layoutComponents": [
{
"componentType": "Field",
"apiName": "ParentId",
"label": "Parent Account ID"
}
],
"label": "Parent Account",
"lookupIdApiName": "ParentId",
"sortable": false,
"required": false
},
{
"editableForUpdate": true,
"editableForNew": true,
"layoutComponents": [
{
"componentType": "Field",
"apiName": "Fax",
"label": "Account Fax"
}
],
"label": "Fax",
"lookupIdApiName": null,
"sortable": false,
"required": false
}
]
},
{
"layoutItems": [
{
"editableForUpdate": true,
"editableForNew": true,
"layoutComponents": [
{
"componentType": "Field",
"apiName": "AccountNumber",
"label": "Account Number"
}
],
"label": "Account Number",
"lookupIdApiName": null,
"sortable": false,
"required": false
},
{
"editableForUpdate": true,
"editableForNew": true,
"layoutComponents": [
{
"componentType": "Field",
"apiName": "Website",
"label": "Website"
}
],
"label": "Website",
"lookupIdApiName": null,
"sortable": false,
"required": false
}
]
},
{
"layoutItems": [
{
"editableForUpdate": true,
"editableForNew": true,
"layoutComponents": [
{
"componentType": "Field",
"apiName": "Site",
"label": "Account Site"
}
],
"label": "Account Site",
"lookupIdApiName": null,
"sortable": false,
"required": false
},
{
"editableForUpdate": true,
"editableForNew": true,
"layoutComponents": [
{
"componentType": "Field",
"apiName": "TickerSymbol",
"label": "Ticker Symbol"
}
],
"label": "Ticker Symbol",
"lookupIdApiName": null,
"sortable": false,
"required": false
}
]
},
{
"layoutItems": [
{
"editableForUpdate": true,
"editableForNew": true,
"layoutComponents": [
{
"componentType": "Field",
"apiName": "Type",
"label": "Account Type"
}
],
"label": "Type",
"lookupIdApiName": null,
"sortable": false,
"required": false
},
{
"editableForUpdate": true,
"editableForNew": true,
"layoutComponents": [
{
"componentType": "Field",
"apiName": "Ownership",
"label": "Ownership"
}
],
"label": "Ownership",
"lookupIdApiName": null,
"sortable": false,
"required": false
}
]
},
{
"layoutItems": [
{
"editableForUpdate": true,
"editableForNew": true,
"layoutComponents": [
{
"componentType": "Field",
"apiName": "Industry",
"label": "Industry"
}
],
"label": "Industry",
"lookupIdApiName": null,
"sortable": false,
"required": false
},
{
"editableForUpdate": true,
"editableForNew": true,
"layoutComponents": [
{
"componentType": "Field",
"apiName": "NumberOfEmployees",
"label": "Employees"
}
],
"label": "Employees",
"lookupIdApiName": null,
"sortable": false,
"required": false
}
]
},
{
"layoutItems": [
{
"editableForUpdate": true,
"editableForNew": true,
"layoutComponents": [
{
"componentType": "Field",
"apiName": "AnnualRevenue",
"label": "Annual Revenue"
}
],
"label": "Annual Revenue",
"lookupIdApiName": null,
"sortable": false,
"required": false
},
{
"editableForUpdate": true,
"editableForNew": true,
"layoutComponents": [
{
"componentType": "Field",
"apiName": "Sic",
"label": "SIC Code"
}
],
"label": "SIC Code",
"lookupIdApiName": null,
"sortable": false,
"required": false
}
]
}
]
},
{
"heading": "Address Information",
"columns": 2,
"id": "01B5g000015Z7yhEAC",
"rows": 1,
"collapsible": false,
"useHeading": false,
"layoutRows": [
{
"layoutItems": [
{
"editableForUpdate": true,
"editableForNew": true,
"layoutComponents": [
{
"componentType": "Field",
"apiName": "BillingStreet",
"label": "Billing Street"
},
{
"componentType": "Field",
"apiName": "BillingCity",
"label": "Billing City"
},
{
"componentType": "Field",
"apiName": "BillingState",
"label": "Billing State/Province"
},
{
"componentType": "Field",
"apiName": "BillingPostalCode",
"label": "Billing Zip/Postal Code"
},
{
"componentType": "Field",
"apiName": "BillingCountry",
"label": "Billing Country"
}
],
"label": "Billing Address",
"lookupIdApiName": null,
"sortable": false,
"required": false
},
{
"editableForUpdate": true,
"editableForNew": true,
"layoutComponents": [
{
"componentType": "Field",
"apiName": "ShippingStreet",
"label": "Shipping Street"
},
{
"componentType": "Field",
"apiName": "ShippingCity",
"label": "Shipping City"
},
{
"componentType": "Field",
"apiName": "ShippingState",
"label": "Shipping State/Province"
},
{
"componentType": "Field",
"apiName": "ShippingPostalCode",
"label": "Shipping Zip/Postal Code"
},
{
"componentType": "Field",
"apiName": "ShippingCountry",
"label": "Shipping Country"
}
],
"label": "Shipping Address",
"lookupIdApiName": null,
"sortable": false,
"required": false
}
]
}
]
},
{
"heading": "Additional Information",
"columns": 2,
"id": "01B5g000015Z7yfEAC",
"rows": 4,
"collapsible": false,
"useHeading": false,
"layoutRows": [
{
"layoutItems": [
{
"editableForUpdate": true,
"editableForNew": true,
"layoutComponents": [
{
"componentType": "Field",
"apiName": "CustomerPriority__c",
"label": "Customer Priority"
}
],
"label": "Customer Priority",
"lookupIdApiName": null,
"sortable": false,
"required": false
},
{
"editableForUpdate": true,
"editableForNew": true,
"layoutComponents": [
{
"componentType": "Field",
"apiName": "SLA__c",
"label": "SLA"
}
],
"label": "SLA",
"lookupIdApiName": null,
"sortable": false,
"required": false
}
]
},
{
"layoutItems": [
{
"editableForUpdate": true,
"editableForNew": true,
"layoutComponents": [
{
"componentType": "Field",
"apiName": "SLAExpirationDate__c",
"label": "SLA Expiration Date"
}
],
"label": "SLA Expiration Date",
"lookupIdApiName": null,
"sortable": false,
"required": false
},
{
"editableForUpdate": true,
"editableForNew": true,
"layoutComponents": [
{
"componentType": "Field",
"apiName": "SLASerialNumber__c",
"label": "SLA Serial Number"
}
],
"label": "SLA Serial Number",
"lookupIdApiName": null,
"sortable": false,
"required": false
}
]
},
{
"layoutItems": [
{
"editableForUpdate": true,
"editableForNew": true,
"layoutComponents": [
{
"componentType": "Field",
"apiName": "NumberofLocations__c",
"label": "Number of Locations"
}
],
"label": "Number of Locations",
"lookupIdApiName": null,
"sortable": false,
"required": false
},
{
"editableForUpdate": true,
"editableForNew": true,
"layoutComponents": [
{
"componentType": "Field",
"apiName": "UpsellOpportunity__c",
"label": "Upsell Opportunity"
}
],
"label": "Upsell Opportunity",
"lookupIdApiName": null,
"sortable": false,
"required": false
}
]
},
{
"layoutItems": [
{
"editableForUpdate": true,
"editableForNew": true,
"layoutComponents": [
{
"componentType": "Field",
"apiName": "Active__c",
"label": "Active"
}
],
"label": "Active",
"lookupIdApiName": null,
"sortable": false,
"required": false
}
]
}
]
},
{
"heading": "System Information",
"columns": 2,
"id": "01B5g000015Z7ygEAC",
"rows": 1,
"collapsible": false,
"useHeading": false,
"layoutRows": [
{
"layoutItems": [
]
}
]
},
{
"heading": "Description Information",
"columns": 1,
"id": "01B5g000015Z7yiEAC",
"rows": 1,
"collapsible": false,
"useHeading": false,
"layoutRows": [
{
"layoutItems": [
{
"editableForUpdate": true,
"editableForNew": true,
"layoutComponents": [
{
"componentType": "Field",
"apiName": "Description",
"label": "Account Description"
}
],
"label": "Description",
"lookupIdApiName": null,
"sortable": false,
"required": false
}
]
}
]
},
{
"heading": "Custom Links",
"columns": 3,
"id": "01B5g000015Z7ydEAC",
"rows": 1,
"collapsible": false,
"useHeading": false,
"layoutRows": [
{
"layoutItems": [
]
}
]
}
],
[
{
"heading": "Account Information",
"columns": 2,
"id": "01B5g000015Z7yeEAC",
"rows": 8,
"collapsible": false,
"useHeading": false,
"layoutRows": [
{
"layoutItems": [
{
"editableForUpdate": true,
"editableForNew": true,
"layoutComponents": [
{
"componentType": "Field",
"apiName": "Rating",
"label": "Account Rating"
}
],
"label": "Rating",
"lookupIdApiName": null,
"sortable": false,
"required": false
}
]
},
{
"layoutItems": [
{
"editableForUpdate": true,
"editableForNew": true,
"layoutComponents": [
{
"componentType": "Field",
"apiName": "Name",
"label": "Account Name"
}
],
"label": "Account Name",
"lookupIdApiName": "Id",
"sortable": false,
"required": true
},
{
"editableForUpdate": true,
"editableForNew": true,
"layoutComponents": [
{
"componentType": "Field",
"apiName": "Phone",
"label": "Account Phone"
}
],
"label": "Phone",
"lookupIdApiName": null,
"sortable": false,
"required": false
}
]
},
{
"layoutItems": [
{
"editableForUpdate": true,
"editableForNew": true,
"layoutComponents": [
{
"componentType": "Field",
"apiName": "ParentId",
"label": "Parent Account ID"
}
],
"label": "Parent Account",
"lookupIdApiName": "ParentId",
"sortable": false,
"required": false
},
{
"editableForUpdate": true,
"editableForNew": true,
"layoutComponents": [
{
"componentType": "Field",
"apiName": "Fax",
"label": "Account Fax"
}
],
"label": "Fax",
"lookupIdApiName": null,
"sortable": false,
"required": false
}
]
},
{
"layoutItems": [
{
"editableForUpdate": true,
"editableForNew": true,
"layoutComponents": [
{
"componentType": "Field",
"apiName": "AccountNumber",
"label": "Account Number"
}
],
"label": "Account Number",
"lookupIdApiName": null,
"sortable": false,
"required": false
},
{
"editableForUpdate": true,
"editableForNew": true,
"layoutComponents": [
{
"componentType": "Field",
"apiName": "Website",
"label": "Website"
}
],
"label": "Website",
"lookupIdApiName": null,
"sortable": false,
"required": false
}
]
},
{
"layoutItems": [
{
"editableForUpdate": true,
"editableForNew": true,
"layoutComponents": [
{
"componentType": "Field",
"apiName": "Site",
"label": "Account Site"
}
],
"label": "Account Site",
"lookupIdApiName": null,
"sortable": false,
"required": false
},
{
"editableForUpdate": true,
"editableForNew": true,
"layoutComponents": [
{
"componentType": "Field",
"apiName": "TickerSymbol",
"label": "Ticker Symbol"
}
],
"label": "Ticker Symbol",
"lookupIdApiName": null,
"sortable": false,
"required": false
}
]
},
{
"layoutItems": [
{
"editableForUpdate": true,
"editableForNew": true,
"layoutComponents": [
{
"componentType": "Field",
"apiName": "Type",
"label": "Account Type"
}
],
"label": "Type",
"lookupIdApiName": null,
"sortable": false,
"required": false
},
{
"editableForUpdate": true,
"editableForNew": true,
"layoutComponents": [
{
"componentType": "Field",
"apiName": "Ownership",
"label": "Ownership"
}
],
"label": "Ownership",
"lookupIdApiName": null,
"sortable": false,
"required": false
}
]
},
{
"layoutItems": [
{
"editableForUpdate": true,
"editableForNew": true,
"layoutComponents": [
{
"componentType": "Field",
"apiName": "Industry",
"label": "Industry"
}
],
"label": "Industry",
"lookupIdApiName": null,
"sortable": false,
"required": false
},
{
"editableForUpdate": true,
"editableForNew": true,
"layoutComponents": [
{
"componentType": "Field",
"apiName": "NumberOfEmployees",
"label": "Employees"
}
],
"label": "Employees",
"lookupIdApiName": null,
"sortable": false,
"required": false
}
]
},
{
"layoutItems": [
{
"editableForUpdate": true,
"editableForNew": true,
"layoutComponents": [
{
"componentType": "Field",
"apiName": "AnnualRevenue",
"label": "Annual Revenue"
}
],
"label": "Annual Revenue",
"lookupIdApiName": null,
"sortable": false,
"required": false
},
{
"editableForUpdate": true,
"editableForNew": true,
"layoutComponents": [
{
"componentType": "Field",
"apiName": "Sic",
"label": "SIC Code"
}
],
"label": "SIC Code",
"lookupIdApiName": null,
"sortable": false,
"required": false
}
]
}
]
},
{
"heading": "Address Information",
"columns": 2,
"id": "01B5g000015Z7yhEAC",
"rows": 1,
"collapsible": false,
"useHeading": false,
"layoutRows": [
{
"layoutItems": [
{
"editableForUpdate": true,
"editableForNew": true,
"layoutComponents": [
{
"componentType": "Field",
"apiName": "BillingStreet",
"label": "Billing Street"
},
{
"componentType": "Field",
"apiName": "BillingCity",
"label": "Billing City"
},
{
"componentType": "Field",
"apiName": "BillingState",
"label": "Billing State/Province"
},
{
"componentType": "Field",
"apiName": "BillingPostalCode",
"label": "Billing Zip/Postal Code"
},
{
"componentType": "Field",
"apiName": "BillingCountry",
"label": "Billing Country"
}
],
"label": "Billing Address",
"lookupIdApiName": null,
"sortable": false,
"required": false
},
{
"editableForUpdate": true,
"editableForNew": true,
"layoutComponents": [
{
"componentType": "Field",
"apiName": "ShippingStreet",
"label": "Shipping Street"
},
{
"componentType": "Field",
"apiName": "ShippingCity",
"label": "Shipping City"
},
{
"componentType": "Field",
"apiName": "ShippingState",
"label": "Shipping State/Province"
},
{
"componentType": "Field",
"apiName": "ShippingPostalCode",
"label": "Shipping Zip/Postal Code"
},
{
"componentType": "Field",
"apiName": "ShippingCountry",
"label": "Shipping Country"
}
],
"label": "Shipping Address",
"lookupIdApiName": null,
"sortable": false,
"required": false
}
]
}
]
},
{
"heading": "Additional Information",
"columns": 2,
"id": "01B5g000015Z7yfEAC",
"rows": 4,
"collapsible": false,
"useHeading": false,
"layoutRows": [
{
"layoutItems": [
{
"editableForUpdate": true,
"editableForNew": true,
"layoutComponents": [
{
"componentType": "Field",
"apiName": "CustomerPriority__c",
"label": "Customer Priority"
}
],
"label": "Customer Priority",
"lookupIdApiName": null,
"sortable": false,
"required": false
},
{
"editableForUpdate": true,
"editableForNew": true,
"layoutComponents": [
{
"componentType": "Field",
"apiName": "SLA__c",
"label": "SLA"
}
],
"label": "SLA",
"lookupIdApiName": null,
"sortable": false,
"required": false
}
]
},
{
"layoutItems": [
{
"editableForUpdate": true,
"editableForNew": true,
"layoutComponents": [
{
"componentType": "Field",
"apiName": "SLAExpirationDate__c",
"label": "SLA Expiration Date"
}
],
"label": "SLA Expiration Date",
"lookupIdApiName": null,
"sortable": false,
"required": false
},
{
"editableForUpdate": true,
"editableForNew": true,
"layoutComponents": [
{
"componentType": "Field",
"apiName": "SLASerialNumber__c",
"label": "SLA Serial Number"
}
],
"label": "SLA Serial Number",
"lookupIdApiName": null,
"sortable": false,
"required": false
}
]
},
{
"layoutItems": [
{
"editableForUpdate": true,
"editableForNew": true,
"layoutComponents": [
{
"componentType": "Field",
"apiName": "NumberofLocations__c",
"label": "Number of Locations"
}
],
"label": "Number of Locations",
"lookupIdApiName": null,
"sortable": false,
"required": false
},
{
"editableForUpdate": true,
"editableForNew": true,
"layoutComponents": [
{
"componentType": "Field",
"apiName": "UpsellOpportunity__c",
"label": "Upsell Opportunity"
}
],
"label": "Upsell Opportunity",
"lookupIdApiName": null,
"sortable": false,
"required": false
}
]
},
{
"layoutItems": [
{
"editableForUpdate": true,
"editableForNew": true,
"layoutComponents": [
{
"componentType": "Field",
"apiName": "Active__c",
"label": "Active"
}
],
"label": "Active",
"lookupIdApiName": null,
"sortable": false,
"required": false
}
]
}
]
},
{
"heading": "System Information",
"columns": 2,
"id": "01B5g000015Z7ygEAC",
"rows": 1,
"collapsible": false,
"useHeading": false,
"layoutRows": [
{
"layoutItems": [
]
}
]
},
{
"heading": "Description Information",
"columns": 1,
"id": "01B5g000015Z7yiEAC",
"rows": 1,
"collapsible": false,
"useHeading": false,
"layoutRows": [
{
"layoutItems": [
{
"editableForUpdate": true,
"editableForNew": true,
"layoutComponents": [
{
"componentType": "Field",
"apiName": "Description",
"label": "Account Description"
}
],
"label": "Description",
"lookupIdApiName": null,
"sortable": false,
"required": false
}
]
}
]
},
{
"heading": "Custom Links",
"columns": 3,
"id": "01B5g000015Z7ydEAC",
"rows": 1,
"collapsible": false,
"useHeading": false,
"layoutRows": [
{
"layoutItems": [
]
}
]
}
]
]
我需要所有具有 editableForUpdate 的标签的值为 true :
我试过 JSONpath 作为 $..layoutRows.[?(@.editableForUpdate == true)])].label 但它没有提供所需的标签值和给出重复值。
你能帮我写出正确的 JSONPATH 表达式吗?
试试下面的 JSONPath
$..layoutItems[?(@.editableForUpdate == true)].layoutComponents[*].label
Jayway JSONPath (A Java DSL) : https://jsonpath.herokuapp.com/
的在线工具