Make JSON
Posted: Thu Jun 06, 2024 8:32 am
Hi All
I have recently upgraded my Switch installation from Spring 2020 to the latest Fall 2023
With that some of the Apps have been upgraded
Since then I had a MAKE JSON command that no longer works, firstly is it possible to roll back the App Version? and if not can anyone identify whats wrong. Reading the notes I think its something to do with the quote marks but not having any luck
Message I see from switch: JSON code failed SyntaxError: Unexpected token / in JSON at position 64
THIS IS MY CODE:
{
"items": [
{
"orderReference": "[Metadata.Text:Path="/Job/JobNo",Dataset="Xml",Model="XML"]",
"recipient": {
"address": {
"fullName": "[Database.Text:SQL="SELECT DeliveryContact FROM MainJobDetails WHERE JobNo = '[Metadata.Text:Path="/Job/JobNo",Dataset="Xml",Model="XML"]'",Connection="PRIMO"]",
"companyName": "[Database.Text:SQL="SELECT DeliveryCustomerName FROM MainJobDetails WHERE JobNo = '[Metadata.Text:Path="/Job/JobNo",Dataset="Xml",Model="XML"]'",Connection="PRIMO"]",
"addressLine1": "[Database.Text:SQL="SELECT DeliveryAddress FROM MainJobDetails WHERE JobNo = '[Metadata.Text:Path="/Job/JobNo",Dataset="Xml",Model="XML"]'",Connection="PRIMO"]",
"addressLine2": "",
"addressLine3": "",
"city": "[Database.Text:SQL="SELECT DeliveryTown FROM MainJobDetails WHERE JobNo = '[Metadata.Text:Path="/Job/JobNo",Dataset="Xml",Model="XML"]'",Connection="PRIMO"]",
"county": "",
"postcode": "[Database.Text:SQL="SELECT DeliveryPostcode FROM MainJobDetails WHERE JobNo = '[Metadata.Text:Path="/Job/JobNo",Dataset="Xml",Model="XML"]'",Connection="PRIMO"]",
"countryCode": ""
},
"phoneNumber": "",
"addressBookReference": ""
},
"sender": {
"tradingName": "Team Impression Ltd",
"phoneNumber": "01132724800",
"emailAddress": "markca@team-impression.com"
},
"packages": [
{
"weightInGrams": 400,
"packageFormatIdentifier": "parcel",
"customPackageFormatIdentifier": "",
"contents": [
{
"name": "",
"SKU": "",
"quantity": 1,
"unitValue": 0,
"unitWeightInGrams": 0,
"customsDescription": "",
"extendedCustomsDescription": "",
"customsCode": "",
"originCountryCode": "",
"customsDeclarationCategory": "none",
"requiresExportLicence": true
}
]
}
],
"orderDate": "[Database.Text:SQL="SELECT Datedb FROM MainJobDetails WHERE JobNo = '[Metadata.Text:Path="/Job/JobNo",Dataset="Xml",Model="XML"]'",Connection="PRIMO"]",
"plannedDespatchDate": "",
"specialInstructions": "",
"subtotal": 0,
"shippingCostCharged": 0,
"otherCosts": 0,
"customsDutyCosts": "",
"total": 0,
"currencyCode": "",
"postageDetails": {
"sendNotificationsTo": "sender",
"serviceCode": "CRL48",
"serviceRegisterCode": "",
"consequentialLoss": "",
"receiveEmailNotification": false,
"receiveSmsNotification": false,
"guaranteedSaturdayDelivery": false,
"requestSignatureUponDelivery": false,
"isLocalCollect": false,
"safePlace": "",
"department": "",
"AIRNumber": "",
"IOSSNumber": "g",
"requiresExportLicense": false,
"commercialInvoiceNumber": "",
"commercialInvoiceDate": "2022-08-24T14:15:22Z"
}
}
]
}
I have recently upgraded my Switch installation from Spring 2020 to the latest Fall 2023
With that some of the Apps have been upgraded
Since then I had a MAKE JSON command that no longer works, firstly is it possible to roll back the App Version? and if not can anyone identify whats wrong. Reading the notes I think its something to do with the quote marks but not having any luck
Message I see from switch: JSON code failed SyntaxError: Unexpected token / in JSON at position 64
THIS IS MY CODE:
{
"items": [
{
"orderReference": "[Metadata.Text:Path="/Job/JobNo",Dataset="Xml",Model="XML"]",
"recipient": {
"address": {
"fullName": "[Database.Text:SQL="SELECT DeliveryContact FROM MainJobDetails WHERE JobNo = '[Metadata.Text:Path="/Job/JobNo",Dataset="Xml",Model="XML"]'",Connection="PRIMO"]",
"companyName": "[Database.Text:SQL="SELECT DeliveryCustomerName FROM MainJobDetails WHERE JobNo = '[Metadata.Text:Path="/Job/JobNo",Dataset="Xml",Model="XML"]'",Connection="PRIMO"]",
"addressLine1": "[Database.Text:SQL="SELECT DeliveryAddress FROM MainJobDetails WHERE JobNo = '[Metadata.Text:Path="/Job/JobNo",Dataset="Xml",Model="XML"]'",Connection="PRIMO"]",
"addressLine2": "",
"addressLine3": "",
"city": "[Database.Text:SQL="SELECT DeliveryTown FROM MainJobDetails WHERE JobNo = '[Metadata.Text:Path="/Job/JobNo",Dataset="Xml",Model="XML"]'",Connection="PRIMO"]",
"county": "",
"postcode": "[Database.Text:SQL="SELECT DeliveryPostcode FROM MainJobDetails WHERE JobNo = '[Metadata.Text:Path="/Job/JobNo",Dataset="Xml",Model="XML"]'",Connection="PRIMO"]",
"countryCode": ""
},
"phoneNumber": "",
"addressBookReference": ""
},
"sender": {
"tradingName": "Team Impression Ltd",
"phoneNumber": "01132724800",
"emailAddress": "markca@team-impression.com"
},
"packages": [
{
"weightInGrams": 400,
"packageFormatIdentifier": "parcel",
"customPackageFormatIdentifier": "",
"contents": [
{
"name": "",
"SKU": "",
"quantity": 1,
"unitValue": 0,
"unitWeightInGrams": 0,
"customsDescription": "",
"extendedCustomsDescription": "",
"customsCode": "",
"originCountryCode": "",
"customsDeclarationCategory": "none",
"requiresExportLicence": true
}
]
}
],
"orderDate": "[Database.Text:SQL="SELECT Datedb FROM MainJobDetails WHERE JobNo = '[Metadata.Text:Path="/Job/JobNo",Dataset="Xml",Model="XML"]'",Connection="PRIMO"]",
"plannedDespatchDate": "",
"specialInstructions": "",
"subtotal": 0,
"shippingCostCharged": 0,
"otherCosts": 0,
"customsDutyCosts": "",
"total": 0,
"currencyCode": "",
"postageDetails": {
"sendNotificationsTo": "sender",
"serviceCode": "CRL48",
"serviceRegisterCode": "",
"consequentialLoss": "",
"receiveEmailNotification": false,
"receiveSmsNotification": false,
"guaranteedSaturdayDelivery": false,
"requestSignatureUponDelivery": false,
"isLocalCollect": false,
"safePlace": "",
"department": "",
"AIRNumber": "",
"IOSSNumber": "g",
"requiresExportLicense": false,
"commercialInvoiceNumber": "",
"commercialInvoiceDate": "2022-08-24T14:15:22Z"
}
}
]
}