Below is a JSON object that was extracted from an invoice’s line items. I am trying to use this object to create line item records for each invoice.
What is the best way to parse this response into individual objects that I can create records from?
I am assuming that I am going to want to use JSON.parse in a Javascript column, but I am getting stumped on the config for that column.
Thanks in advance.
{
"line-items": [
{
"date": "09/03/2024",
"category": "travel",
"quantity": 1,
"unit type": "hours",
"unit price": 125,
"description": "Road Call Service Charge",
"line item number": 1,
"total line item cost": 125
},
{
"date": "09/03/2024",
"category": "service",
"quantity": 2,
"unit type": "hours",
"unit price": 145,
"description": "Traveled to troubleshoot generator power issue, discovered bad generator controller.",
"line item number": 2,
"total line item cost": 290
},
{
"date": "09/05/2024",
"category": "travel",
"quantity": 1,
"unit type": "hours",
"unit price": 125,
"description": "Road Call Service Charge",
"line item number": 3,
"total line item cost": 125
},
{
"date": "09/05/2024",
"category": "service",
"quantity": 2.5,
"unit type": "hours",
"unit price": 145,
"description": "Removed & replaced generator controller; calibrated new controller.",
"line item number": 4,
"total line item cost": 362.5
},
{
"date": "09/05/2024",
"category": "parts",
"quantity": 1,
"unit type": "units",
"unit price": 1396.74,
"description": "Onan Controller",
"line item number": 5,
"total line item cost": 1396.74
},
{
"date": "09/05/2024",
"category": "parts",
"quantity": 1,
"unit type": "units",
"unit price": 62.62,
"description": "Shipping",
"line item number": 6,
"total line item cost": 62.62
},
{
"date": "09/05/2024",
"category": "fees",
"quantity": 1,
"unit type": "units",
"unit price": 75.55,
"description": "Credit Card Convenience Fee",
"line item number": 7,
"total line item cost": 75.55
}
]
}