Skip to content

Commit 466286a

Browse files
committed
use tableName instaed of tableId for personal accounts
1 parent 950a2d1 commit 466286a

File tree

5 files changed

+31
-7
lines changed

5 files changed

+31
-7
lines changed

components/microsoft_excel/actions/add-a-worksheet-tablerow/add-a-worksheet-tablerow.mjs

Lines changed: 25 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import microsoftExcel from "../../microsoft_excel.app.mjs";
44
export default {
55
key: "microsoft_excel-add-a-worksheet-tablerow",
66
name: "Add A Worksheet Tablerow",
7-
version: "0.0.2",
7+
version: "0.0.3",
88
description: "Adds rows to the end of specific table. [See the documentation](https://learn.microsoft.com/en-us/graph/api/tablerowcollection-add?view=graph-rest-1.0&tabs=http)",
99
type: "action",
1010
props: {
@@ -23,6 +23,7 @@ export default {
2323
folderId,
2424
}),
2525
],
26+
reloadProps: true,
2627
},
2728
tableId: {
2829
propDefinition: [
@@ -32,6 +33,13 @@ export default {
3233
itemId,
3334
}),
3435
],
36+
hidden: true,
37+
},
38+
tableName: {
39+
type: "string",
40+
label: "Table Name",
41+
description: "This is set in the **Table Design** tab of the ribbon.",
42+
hidden: true,
3543
},
3644
values: {
3745
propDefinition: [
@@ -40,18 +48,34 @@ export default {
4048
],
4149
},
4250
},
51+
async additionalProps(props) {
52+
if (this.itemId) {
53+
try {
54+
await this.microsoftExcel.listTables({
55+
itemId: this.itemId,
56+
});
57+
} catch {
58+
props.tableName.hidden = false;
59+
return {};
60+
}
61+
props.tableId.hidden = false;
62+
return {};
63+
}
64+
},
4365
async run({ $ }) {
4466
const {
4567
microsoftExcel,
4668
itemId,
4769
tableId,
70+
tableName,
4871
values,
4972
} = this;
5073

5174
const response = await microsoftExcel.addRow({
5275
$,
5376
itemId,
5477
tableId,
78+
tableName,
5579
data: {
5680
values: parseObject(values),
5781
},

components/microsoft_excel/actions/update-worksheet-tablerow/update-worksheet-tablerow.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import microsoftExcel from "../../microsoft_excel.app.mjs";
33
export default {
44
key: "microsoft_excel-update-worksheet-tablerow",
55
name: "Update Worksheet Tablerow",
6-
version: "0.0.2",
6+
version: "0.0.3",
77
description: "Update the properties of tablerow object. `(Only for work or school account)` [See the documentation](https://learn.microsoft.com/en-us/graph/api/tablerow-update?view=graph-rest-1.0&tabs=http)",
88
type: "action",
99
props: {

components/microsoft_excel/microsoft_excel.app.mjs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -99,11 +99,11 @@ export default {
9999
return axios($, config);
100100
},
101101
addRow({
102-
itemId, tableId, ...args
102+
itemId, tableId, tableName, ...args
103103
}) {
104104
return this._makeRequest({
105105
method: "POST",
106-
path: `me/drive/items/${itemId}/workbook/tables/${tableId}/rows`,
106+
path: `me/drive/items/${itemId}/workbook/tables/${tableId || tableName}/rows/add`,
107107
...args,
108108
});
109109
},

components/microsoft_excel/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@pipedream/microsoft_excel",
3-
"version": "0.1.1",
3+
"version": "0.1.2",
44
"description": "Pipedream Microsoft Excel Components",
55
"main": "microsoft_excel.app.mjs",
66
"keywords": [
@@ -13,7 +13,7 @@
1313
"access": "public"
1414
},
1515
"dependencies": {
16-
"@pipedream/platform": "^1.5.1",
16+
"@pipedream/platform": "^3.0.3",
1717
"moment": "^2.29.4"
1818
}
1919
}

components/microsoft_excel/sources/new-item-updated/new-item-updated.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ export default {
77
key: "microsoft_excel-new-item-updated",
88
name: "New Item Updated (Instant)",
99
description: "Emit new event when an item is updated.",
10-
version: "0.0.2",
10+
version: "0.0.3",
1111
type: "source",
1212
props: {
1313
microsoftExcel,

0 commit comments

Comments
 (0)