Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ export default {
key: "google_sheets-create-spreadsheet",
name: "Create Spreadsheet",
description: "Create a blank spreadsheet or duplicate an existing spreadsheet. [See the documentation](https://developers.google.com/sheets/api/reference/rest/v4/spreadsheets/create)",
version: "0.1.9",
version: "0.1.10",
type: "action",
props: {
googleSheets,
Expand All @@ -20,6 +20,17 @@ export default {
label: "Title",
description: "The title of the new spreadsheet",
},
folderId: {
propDefinition: [
googleSheets,
"folderId",
(c) => ({
drive: c.drive,
}),
],
description: "The folder you want to save the file to",
optional: true,
},
sheetId: {
propDefinition: [
googleSheets,
Expand All @@ -32,10 +43,11 @@ export default {
optional: true,
},
},
async run() {
async run({ $ }) {
const {
googleSheets,
sheetId,
folderId,
title,
drive,
} = this;
Expand All @@ -48,26 +60,32 @@ export default {
isMyDrive,
} = googleSheets;

let response;
if (sheetId) {
return copySpreadsheet(sheetId, title);
response = await copySpreadsheet(sheetId, title);
} else {
response = await createSpreadsheet({
resource: {
properties: {
title,
},
},
});
}

const response = await createSpreadsheet({
resource: {
properties: {
title,
},
},
});
const spreadsheetId = response?.spreadsheetId || response?.id;
const summary = `Successfully created spreadsheet with ID: ${spreadsheetId}`;

if (isMyDrive(drive)) {
if (!folderId && isMyDrive(drive)) {
$.export("$summary", summary);
return response;
}

const spreadsheet = await updateFile(response.spreadsheetId, {
addParents: drive,
const spreadsheet = await updateFile(spreadsheetId, {
addParents: folderId || drive,
});

$.export("$summary", summary);
return getSpreadsheet(spreadsheet.id);
},
};
2 changes: 1 addition & 1 deletion components/google_sheets/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@pipedream/google_sheets",
"version": "0.8.1",
"version": "0.8.2",
"description": "Pipedream Google_sheets Components",
"main": "google_sheets.app.mjs",
"keywords": [
Expand Down
2 changes: 1 addition & 1 deletion components/hubflo/hubflo.app.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@ export default {
console.log(Object.keys(this.$auth));
},
},
};
};
2 changes: 1 addition & 1 deletion components/lamini/lamini.app.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@ export default {
console.log(Object.keys(this.$auth));
},
},
};
};
2 changes: 1 addition & 1 deletion components/lead_identity_check/lead_identity_check.app.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@ export default {
console.log(Object.keys(this.$auth));
},
},
};
};
2 changes: 1 addition & 1 deletion components/magileads/magileads.app.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@ export default {
console.log(Object.keys(this.$auth));
},
},
};
};
2 changes: 1 addition & 1 deletion components/maileroo/maileroo.app.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@ export default {
console.log(Object.keys(this.$auth));
},
},
};
};
2 changes: 1 addition & 1 deletion components/murf/murf.app.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@ export default {
console.log(Object.keys(this.$auth));
},
},
};
};
2 changes: 1 addition & 1 deletion components/nextlead/nextlead.app.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@ export default {
console.log(Object.keys(this.$auth));
},
},
};
};
2 changes: 1 addition & 1 deletion components/pushinator/pushinator.app.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@ export default {
console.log(Object.keys(this.$auth));
},
},
};
};
2 changes: 1 addition & 1 deletion components/uspacy/uspacy.app.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@ export default {
console.log(Object.keys(this.$auth));
},
},
};
};
2 changes: 1 addition & 1 deletion components/utopian_labs/utopian_labs.app.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@ export default {
console.log(Object.keys(this.$auth));
},
},
};
};
2 changes: 1 addition & 1 deletion components/veedea/veedea.app.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@ export default {
console.log(Object.keys(this.$auth));
},
},
};
};
8 changes: 0 additions & 8 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading