Edits history of script submission #37 for ' Add Rows (gsheets)'

  • deno
    One script reply has been approved by the moderators
    Ap­pro­ved
    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 hugo697 372 days ago

  • deno
    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 1005 days ago

  • deno
    
    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 1008 days ago

  • deno
    import * as wmill from "https://deno.land/x/[email protected]/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 1136 days ago

  • deno
    import * as wmill from "https://deno.land/x/[email protected]/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 1171 days ago

  • deno
    import * as wmill from "https://deno.land/x/[email protected]/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 1379 days ago

  • deno
    import * as wmill from "https://deno.land/x/[email protected]/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 1388 days ago

  • deno
    import * as wmill from "https://deno.land/x/[email protected]/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 1389 days ago