Skip to content

Commit 1cb2964

Browse files
committed
add folderId prop
1 parent 0129ef7 commit 1cb2964

File tree

2 files changed

+16
-4
lines changed

2 files changed

+16
-4
lines changed

components/google_sheets/actions/create-spreadsheet/create-spreadsheet.mjs

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ export default {
44
key: "google_sheets-create-spreadsheet",
55
name: "Create Spreadsheet",
66
description: "Create a blank spreadsheet or duplicate an existing spreadsheet. [See the documentation](https://developers.google.com/sheets/api/reference/rest/v4/spreadsheets/create)",
7-
version: "0.1.9",
7+
version: "0.1.10",
88
type: "action",
99
props: {
1010
googleSheets,
@@ -20,6 +20,17 @@ export default {
2020
label: "Title",
2121
description: "The title of the new spreadsheet",
2222
},
23+
folderId: {
24+
propDefinition: [
25+
googleSheets,
26+
"folderId",
27+
(c) => ({
28+
drive: c.drive,
29+
}),
30+
],
31+
description: "The folder you want to save the file to",
32+
optional: true,
33+
},
2334
sheetId: {
2435
propDefinition: [
2536
googleSheets,
@@ -36,6 +47,7 @@ export default {
3647
const {
3748
googleSheets,
3849
sheetId,
50+
folderId,
3951
title,
4052
drive,
4153
} = this;
@@ -60,12 +72,12 @@ export default {
6072
},
6173
});
6274

63-
if (isMyDrive(drive)) {
75+
if (!folderId && isMyDrive(drive)) {
6476
return response;
6577
}
6678

6779
const spreadsheet = await updateFile(response.spreadsheetId, {
68-
addParents: drive,
80+
addParents: folderId || drive,
6981
});
7082

7183
return getSpreadsheet(spreadsheet.id);

components/google_sheets/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@pipedream/google_sheets",
3-
"version": "0.8.1",
3+
"version": "0.8.2",
44
"description": "Pipedream Google_sheets Components",
55
"main": "google_sheets.app.mjs",
66
"keywords": [

0 commit comments

Comments
 (0)