I'm trying to select just a few fields from a JSON array however I am unsure of the syntax for the mapping.
[
{
"@odata.context": "https://default-a6574859-de41-472d-9901-f7360699b943.09.common.uk.azure-apihub.net/apim/dynamicssmbsaas/shared-dynamicssmbsa-cc155aff-bd22-4890-8daf-154401d9f385/$metadata#bcenvironments('SANDBOX')/companies(fe0d2a07-199d-ef11-8a6b-6045bd1304c1)/datasets('v2.0')/tables('salesOrderLines')/items",
"value": [
{
"@odata.etag": "W/\"JzIwOzE3MjE0NzkzODEzOTcyNDkwMzk2MTswMDsn\"",
"ItemInternalId": "277aaf99-ba9d-ef11-8a6b-7c1e5203ae35",
"id": "277aaf99-ba9d-ef11-8a6b-7c1e5203ae35",
"documentId": "237aaf99-ba9d-ef11-8a6b-7c1e5203ae35",
"sequence": 1,
"itemId": "6b06e355-e592-ef11-8a6b-6045bdfbe09a",
"accountId": "00000000-0000-0000-0000-000000000000",
"lineType@odata.type": "#Microsoft.NAV.invoiceLineAggLineType",
"lineType": "Item",
"lineObjectNumber": "1234",
"description": "TestProduct1",
"description2": "",
"unitOfMeasureId": "e03023a6-60e0-ee11-904f-0022484315d5",
"unitOfMeasureCode": "CASE",
"quantity": 99,
"unitPrice": 99.99,
"discountAmount": 0,
"discountPercent": 0,
"discountAppliedBeforeTax": false,
"amountExcludingTax": 999.9,
"taxCode": "20% VAT",
"taxPercent": 20,
"totalTaxAmount": 99.99,
"amountIncludingTax": 999.99,
"invoiceDiscountAllocation": 0,
"netAmount": 999.9,
"netTaxAmount": 99.99,
"netAmountIncludingTax": 999.99,
"shipmentDate": "2024-01-01",
"shippedQuantity": 0,
"invoicedQuantity": 0,
"invoiceQuantity": 99,
"shipQuantity": 99,
"itemVariantId": "00000000-0000-0000-0000-000000000000",
"locationId": "4e05507c-60e0-ee11-904f-0022484315d5"
},
{
"@odata.etag": "W/\"JzE5Ozc0NTUzMjc4Mzg3MjU3ODM3NDIxOzAwOyc=\"",
"ItemInternalId": "2c7aaf99-ba9d-ef11-8a6b-7c1e5203ae35",
"id": "2c7aaf99-ba9d-ef11-8a6b-7c1e5203ae35",
"documentId": "237aaf99-ba9d-ef11-8a6b-7c1e5203ae35",
"sequence": 2,
"itemId": "6a06e355-e592-ef11-8a6b-6045bdfbe09a",
"accountId": "00000000-0000-0000-0000-000000000000",
"lineType@odata.type": "#Microsoft.NAV.invoiceLineAggLineType",
"lineType": "Item",
"lineObjectNumber": "4321",
"description": "TestProduct2",
"description2": "",
"unitOfMeasureId": "e03023a6-60e0-ee11-904f-0022484315d5",
"unitOfMeasureCode": "CASE",
"quantity": 99,
"unitPrice": 99.99,
"discountAmount": 0,
"discountPercent": 0,
"discountAppliedBeforeTax": false,
"amountExcludingTax": 999.9,
"taxCode": "20% VAT",
"taxPercent": 20,
"totalTaxAmount": 99.99,
"amountIncludingTax": 999.99,
"invoiceDiscountAllocation": 0,
"netAmount": 999.9,
"netTaxAmount": 99.99,
"netAmountIncludingTax": 999.99,
"shipmentDate": "2024-01-21",
"shippedQuantity": 0,
"invoicedQuantity": 0,
"invoiceQuantity": 99,
"shipQuantity": 99,
"itemVariantId": "00000000-0000-0000-0000-000000000000",
"locationId": "4e05507c-60e0-ee11-904f-0022484315d5"
},
{
"@odata.etag": "W/\"JzE5OzEzOTM4OTU3MzI4NzY1NzQ4OTQxOzAwOyc=\"",
"ItemInternalId": "317aaf99-ba9d-ef11-8a6b-7c1e5203ae35",
"id": "317aaf99-ba9d-ef11-8a6b-7c1e5203ae35",
"documentId": "237aaf99-ba9d-ef11-8a6b-7c1e5203ae35",
"sequence": 3,
"itemId": "8351e261-e592-ef11-8a6b-6045bdfbe09a",
"accountId": "00000000-0000-0000-0000-000000000000",
"lineType@odata.type": "#Microsoft.NAV.invoiceLineAggLineType",
"lineType": "Item",
"lineObjectNumber": "5555",
"description": "TestProduct3",
"description2": "",
"unitOfMeasureId": "e03023a6-60e0-ee11-904f-0022484315d5",
"unitOfMeasureCode": "CASE",
"quantity": 99,
"unitPrice": 99.99,
"discountAmount": 0,
"discountPercent": 0,
"discountAppliedBeforeTax": false,
"amountExcludingTax": 999.99,
"taxCode": "20% VAT",
"taxPercent": 20,
"totalTaxAmount": 999.99,
"amountIncludingTax": 9999.99,
"invoiceDiscountAllocation": 0,
"netAmount": 999.99,
"netTaxAmount": 999.99,
"netAmountIncludingTax": 9999.99,
"shipmentDate": "2024-01-01",
"shippedQuantity": 0,
"invoicedQuantity": 0,
"invoiceQuantity": 99,
"shipQuantity": 99,
"itemVariantId": "00000000-0000-0000-0000-000000000000",
"locationId": "4e05507c-60e0-ee11-904f-0022484315d5"
}
]
}
]
I wish to say select, "id" and "documentId" from this to pass into another action, but in my output I just get all my objects assigned to both id and documentId.
{
"body": [
{
"id": {
"@odata.etag": "W/\"JzE5OzQ1MzI2MzUxOTI2Mjk2MDU4NDAxOzAwOyc=\"",
"ItemInternalId": "367aaf99-ba9d-ef11-8a6b-7c1e5203ae35",
"id": "367aaf99-ba9d-ef11-8a6b-7c1e5203ae35",
"documentId": "237aaf99-ba9d-ef11-8a6b-7c1e5203ae35",
"sequence": 1,
"itemId": "8451e261-e592-ef11-8a6b-6045bdfbe09a",
"accountId": "00000000-0000-0000-0000-000000000000",
"lineType@odata.type": "#Microsoft.NAV.invoiceLineAggLineType",
"lineType": "Item",
"lineObjectNumber": "1234",
"description": "TestProduct1",
"description2": "",
"unitOfMeasureId": "e03023a6-60e0-ee11-904f-0022484315d5",
"unitOfMeasureCode": "CASE",
"quantity": 99,
"unitPrice": 99.99,
"discountAmount": 0,
"discountPercent": 0,
"discountAppliedBeforeTax": false,
"amountExcludingTax": 999.99,
"taxCode": "20% VAT",
"taxPercent": 20,
"totalTaxAmount": 999.99,
"amountIncludingTax": 9999.99,
"invoiceDiscountAllocation": 0,
"netAmount": 999.99,
"netTaxAmount": 999.99,
"netAmountIncludingTax": 9999.99,
"shipmentDate": "2024-01-01",
"shippedQuantity": 0,
"invoicedQuantity": 0,
"invoiceQuantity": 99,
"shipQuantity": 99,
"itemVariantId": "00000000-0000-0000-0000-000000000000",
"locationId": "4e05507c-60e0-ee11-904f-0022484315d5"
},
"documentId": {
"@odata.etag": "W/\"JzE5OzQ3MzA5MDA1NTE2MzgwODE5NTUxOzAwOyc=\"",
"ItemInternalId": "3b7aaf99-ba9d-ef11-8a6b-7c1e5203ae35",
"id": "3b7aaf99-ba9d-ef11-8a6b-7c1e5203ae35",
"documentId": "237aaf99-ba9d-ef11-8a6b-7c1e5203ae35",
"sequence": 2,
"itemId": "7e51e261-e592-ef11-8a6b-6045bdfbe09a",
"accountId": "00000000-0000-0000-0000-000000000000",
"lineType@odata.type": "#Microsoft.NAV.invoiceLineAggLineType",
"lineType": "Item",
"lineObjectNumber": "4321",
"description": "TestProduct2",
"description2": "",
"unitOfMeasureId": "e03023a6-60e0-ee11-904f-0022484315d5",
"unitOfMeasureCode": "CASE",
"quantity": 99,
"unitPrice": 99.99,
"discountAmount": 0,
"discountPercent": 0,
"discountAppliedBeforeTax": false,
"amountExcludingTax": 999.99,
"taxCode": "20% VAT",
"taxPercent": 20,
"totalTaxAmount": 999.99,
"amountIncludingTax": 9999.99,
"invoiceDiscountAllocation": 0,
"netAmount": 999.99,
"netTaxAmount": 999.99,
"netAmountIncludingTax": 9999.99,
"shipmentDate": "2024-01-01",
"shippedQuantity": 0,
"invoicedQuantity": 0,
"invoiceQuantity": 99,
"shipQuantity": 99,
"itemVariantId": "00000000-0000-0000-0000-000000000000",
"locationId": "4e05507c-60e0-ee11-904f-0022484315d5"
}
}
Would someone be able to help witht he expression I need to only return the two fields? Thanks