I would like to format the result of the json on the sheet.
Example column A slug, B price and C from.
Could you tell me how to do this?
Code :
function appelSorare() {
let graphql = JSON.stringify({
query: `query {
player(slug:"lionel-andres-messi-cuccittini"){
cards(rarities:[limited],after:"") {
nodes {
slug
userOwnerWithRate {
price
from
}
}
pageInfo
{
endCursor
hasNextPage
}
}
}
}`,
variables: null,
});
//ui.alert(graphql);
let params = {
method: "POST",
payload: graphql,
headers: {
"Content-Type": "application/json",
"X-CSRF-Token": "",
},
};
var response = UrlFetchApp.fetch(url, params);
var lists = JSON.parse(response.getContentText());
pCursorAfter = lists["data"]["player"]["cards"]["pageInfo"]["endCursor"];
pLstCard = lists["data"]["player"]["cards"]["nodes"];
pAgain = lists["data"]["player"]["cards"]["pageInfo"]["hasNextPage"];
Logger.log(response);
}
Result Json :
{data={player={cards={nodes=[{slug=lionel-andres-messi-cuccittini-2021-limited-50, userOwnerWithRate={from=2021-09-21T02:21:12Z, price=652000000000000000}}, {userOwnerWithRate={from=2022-04-06T23:45:46Z, price=290000000000000000}, slug=lionel-andres-messi-cuccittini-2021-limited-322}, {slug=lionel-andres-messi-cuccittini-2021-limited-116, userOwnerWithRate={from=2022-02-11T10:09:50Z, price=478200000000000000}}
Thanks