Answer the question
In order to leave comments, you need to log in
How to remove a value from an object?
Good afternoon.
Please tell me how to delete part of the data received via the API with a script.
When requested, I get an object of the following form
[
{number:0,totalPrice:1.0, barcode:7, countryName:Россия}
{number:1,totalPrice:2.0, barcode:8, countryName:Россия}
{number:2,totalPrice:3.0, barcode:6, countryName:Россия}
]
function sendRequestSales() {
let dateFrom = '2021-09-10'
let url = URL + 'sales?dateFrom=' + dateFrom + 'T00:00:00.000Z&flag=1&key=' + TOKEN
let data = [];
let fetch = UrlFetchApp.fetch(url);
let arr = JSON.parse(fetch.getContentText())
let arr2 = arr.forEach(el => delete el[0])
}
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question