type Gsheets = {
token: string;
};
export async function main(
gsheets_auth: Gsheets,
sheet_id: string,
values: Array<Array<any>>,
range: string = "Sheet1",
) {
const body = {
values: values,
};
const valueInputOption = "USER_ENTERED";
const insertDataOption = "INSERT_ROWS";
const includeValuesInResponse = true;
const APPEND_URL = `https://sheets.googleapis.com/v4/spreadsheets/${sheet_id}/values/${range}:append/?valueInputOption=${valueInputOption}&insertDataOption=${insertDataOption}&includeValuesInResponse=${includeValuesInResponse}`;
const token = gsheets_auth["token"];
const response = await fetch(APPEND_URL, {
method: "POST",
body: JSON.stringify(body),
headers: {
Authorization: "Bearer " + token,
"Content-Type": "application/json",
},
});
const result = await response.json();
return { result: result };
}
Submitted by admin 480 days ago
type Gsheets = {
token: string;
};
export async function main(
gsheets_auth: Gsheets,
sheet_id: string,
values: Array<Array<any>>,
range: string = 'Sheet1'
) {
const body = {
"values": values,
};
const valueInputOption = "USER_ENTERED";
const insertDataOption = "INSERT_ROWS";
const includeValuesInResponse = true;
const APPEND_URL =
`https://sheets.googleapis.com/v4/spreadsheets/${sheet_id}/values/${range}:append/?valueInputOption=${valueInputOption}&insertDataOption=${insertDataOption}&includeValuesInResponse=${includeValuesInResponse}`;
const token = gsheets_auth["token"];
const response = await fetch(APPEND_URL, {
method: "POST",
body: JSON.stringify(body),
headers: {
Authorization: "Bearer " + token,
"Content-Type": "application/json",
},
});
const result = await response.json();
return { result: result };
}
Submitted by admin 483 days ago
import * as wmill from "https://deno.land/x/windmill@v1.85.0/mod.ts";
export async function main(
gsheets_auth: wmill.Resource<"gsheets">,
sheet_id: string,
values: Array<Array<any>>,
range: string = 'Sheet1'
) {
const body = {
"values": values,
};
const valueInputOption = "USER_ENTERED";
const insertDataOption = "INSERT_ROWS";
const includeValuesInResponse = true;
const APPEND_URL =
`https://sheets.googleapis.com/v4/spreadsheets/${sheet_id}/values/${range}:append/?valueInputOption=${valueInputOption}&insertDataOption=${insertDataOption}&includeValuesInResponse=${includeValuesInResponse}`;
const token = gsheets_auth["token"];
const response = await fetch(APPEND_URL, {
method: "POST",
body: JSON.stringify(body),
headers: {
Authorization: "Bearer " + token,
"Content-Type": "application/json",
},
});
const result = await response.json();
return { result: result };
}
Submitted by adam186 612 days ago
import * as wmill from "https://deno.land/x/windmill@v1.70.1/mod.ts";
export async function main(
gsheets_auth: wmill.Resource<"gsheets">,
sheet_id: string,
values: Array<Array<any>>,
range: string = 'Sheet1'
) {
const body = {
"values": values,
};
const valueInputOption = "USER_ENTERED";
const insertDataOption = "INSERT_ROWS";
const includeValuesInResponse = true;
const APPEND_URL =
`https://sheets.googleapis.com/v4/spreadsheets/${sheet_id}/values/${range}:append/?valueInputOption=${valueInputOption}&insertDataOption=${insertDataOption}&includeValuesInResponse=${includeValuesInResponse}`;
const token = gsheets_auth["token"];
const response = await fetch(APPEND_URL, {
method: "POST",
body: JSON.stringify(body),
headers: {
Authorization: "Bearer " + token,
"Content-Type": "application/json",
},
});
const result = await response.json();
return { result: result };
}
Submitted by adam186 647 days ago
import * as wmill from "https://deno.land/x/windmill@v1.23.0/mod.ts";
export async function main(
gsheets_auth: wmill.Resource<"gsheets">,
sheet_id: string,
values: Array<Array<any>>,
range: string = 'Sheet1'
) {
const body = {
"values": values,
};
const valueInputOption = "USER_ENTERED";
const insertDataOption = "INSERT_ROWS";
const includeValuesInResponse = true;
const APPEND_URL =
`https://sheets.googleapis.com/v4/spreadsheets/${sheet_id}/values/${range}:append/?valueInputOption=${valueInputOption}&insertDataOption=${insertDataOption}&includeValuesInResponse=${includeValuesInResponse}`;
const token = gsheets_auth["token"];
const response = await fetch(APPEND_URL, {
method: "POST",
body: JSON.stringify(body),
headers: {
Authorization: "Bearer " + token,
"Content-Type": "application/json",
},
});
const result = await response.json();
return { result: result };
}
Submitted by fatonramadani 854 days ago
import * as wmill from "https://deno.land/x/windmill@v1.23.0/mod.ts";
export async function main(
gsheets_auth: wmill.Resource<"gsheets">,
sheet_id: string,
values: Array<Array<any>>,
) {
const body = {
"values": values,
};
const valueInputOption = "USER_ENTERED";
const insertDataOption = "INSERT_ROWS";
const includeValuesInResponse = true;
const range = "Sheet1";
const APPEND_URL =
`https://sheets.googleapis.com/v4/spreadsheets/${sheet_id}/values/${range}:append/?valueInputOption=${valueInputOption}&insertDataOption=${insertDataOption}&includeValuesInResponse=${includeValuesInResponse}`;
const token = gsheets_auth["token"];
const response = await fetch(APPEND_URL, {
method: "POST",
body: JSON.stringify(body),
headers: {
Authorization: "Bearer " + token,
"Content-Type": "application/json",
},
});
const result = await response.json();
return { result: result };
}
Submitted by rossmccrann 864 days ago
import * as wmill from "https://deno.land/x/windmill@v1.23.0/mod.ts";
export async function main(
gsheets_auth: wmill.Resource<"gsheets">,
sheet_id: string,
values: Array<Array<number>>,
) {
const body = {
"values": values,
};
const valueInputOption = "USER_ENTERED";
const insertDataOption = "INSERT_ROWS";
const includeValuesInResponse = true;
const range = "Sheet1";
const APPEND_URL =
`https://sheets.googleapis.com/v4/spreadsheets/${sheet_id}/values/${range}:append/?valueInputOption=${valueInputOption}&insertDataOption=${insertDataOption}&includeValuesInResponse=${includeValuesInResponse}`;
const token = gsheets_auth["token"];
const response = await fetch(APPEND_URL, {
method: "POST",
body: JSON.stringify(body),
headers: {
Authorization: "Bearer " + token,
"Content-Type": "application/json",
},
});
const result = await response.json();
return { result: result };
}
Submitted by rossmccrann 864 days ago