Create JSON file for line items
Hi there,
I want to send my invoice data to a third party accounting tool. Therefore, I want to iterate my Ninox invoice line items, transform them to JSON and send the JSON via REST API to the other tool. I don't get how I can create the array of invoice line items. I know how I can define 1 line item, but not how I can create the array with the multiple line items.
My target format:
[{
item: "1",
description:"ABC"
}, {
item: "2",
description:"DEF"
}
]
How do I create / iterate / "fill" my array?
Many thanks!
Fabi
5 replies
-
JSON Data
formatJSON(jsonObject) - creates a JSON string of a valid JSON object
parseJSON(jsonString) - reconstructs a JSON object from a valid JSON string. In case of an invalid string, the function returns undefined.from the Manual. It may help you.
-
You can also use a select funtion e.g.:
(select invoices).{ desc : DescriptionField, date : format(Datefield, "DD/MM/YYYY"), name : NameField, adress : Adressfield}
This gives as result a true JSON format where you can assign customized fieldnames
Steven
Content aside
- 2 yrs agoLast active
- 5Replies
- 1013Views
-
2
Following