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
116 changes: 105 additions & 11 deletions docs/content/docs/reference/components/microsoft-excel_v1.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -71,8 +71,8 @@ Name: appendRow

| Name | Label | Type | Description | Required |
|:---------------:|:--------------:|:------------:|:-------------------:|:--------:|
| workbookId | Workbook ID | STRING | | true |
| worksheetName | Worksheet | STRING <details> <summary> Depends On </summary> workbookId </details> | | true |
| workbookId | Workbook ID | STRING | The ID of the workbook. | true |
| worksheetName | Worksheet | STRING <details> <summary> Depends On </summary> workbookId </details> | The name of the worksheet. | true |
| isTheFirstRowHeader | Is the First Row Header? | BOOLEAN <details> <summary> Options </summary> <span>true</span>, <span>false</span> </details> | If the first row is header. | true |
| row | | DYNAMIC_PROPERTIES <details> <summary> Depends On </summary> isTheFirstRowHeader, worksheetName, workbookId </details> | | true |

Expand All @@ -97,6 +97,13 @@ The output for this action is dynamic and may vary depending on the input parame



#### Find Workbook ID

To find the Workbook ID, click [here](/reference/components/microsoft-excel_v1#how-to-find-workbook-id).

#### Find Worksheet Name

To find the Worksheet name, click [here](/reference/components/microsoft-excel_v1#how-to-find-worksheet-name).



Expand All @@ -109,8 +116,8 @@ Name: clearWorksheet

| Name | Label | Type | Description | Required |
|:---------------:|:--------------:|:------------:|:-------------------:|:--------:|
| workbookId | Workbook ID | STRING | | true |
| worksheetName | Worksheet | STRING <details> <summary> Depends On </summary> workbookId </details> | | true |
| workbookId | Workbook ID | STRING | The ID of the workbook. | true |
| worksheetName | Worksheet | STRING <details> <summary> Depends On </summary> workbookId </details> | The name of the worksheet. | true |
| isTheFirstRowHeader | Is the First Row Header? | BOOLEAN <details> <summary> Options </summary> <span>true</span>, <span>false</span> </details> | If the first row is header. | true |

#### Example JSON Structure
Expand All @@ -133,6 +140,13 @@ This action does not produce any output.



#### Find Workbook ID

To find the Workbook ID, click [here](/reference/components/microsoft-excel_v1#how-to-find-workbook-id).

#### Find Worksheet Name

To find the Worksheet name, click [here](/reference/components/microsoft-excel_v1#how-to-find-worksheet-name).



Expand All @@ -145,8 +159,8 @@ Name: deleteRow

| Name | Label | Type | Description | Required |
|:---------------:|:--------------:|:------------:|:-------------------:|:--------:|
| workbookId | Workbook ID | STRING | | true |
| worksheetName | Worksheet | STRING <details> <summary> Depends On </summary> workbookId </details> | | true |
| workbookId | Workbook ID | STRING | The ID of the workbook. | true |
| worksheetName | Worksheet | STRING <details> <summary> Depends On </summary> workbookId </details> | The name of the worksheet. | true |
| rowNumber | Row Number | INTEGER | The row number to delete. | true |

#### Example JSON Structure
Expand All @@ -169,6 +183,13 @@ This action does not produce any output.



#### Find Workbook ID

To find the Workbook ID, click [here](/reference/components/microsoft-excel_v1#how-to-find-workbook-id).

#### Find Worksheet Name

To find the Worksheet name, click [here](/reference/components/microsoft-excel_v1#how-to-find-worksheet-name).



Expand All @@ -181,8 +202,8 @@ Name: findRowByNum

| Name | Label | Type | Description | Required |
|:---------------:|:--------------:|:------------:|:-------------------:|:--------:|
| workbookId | Workbook ID | STRING | | true |
| worksheetName | Worksheet | STRING <details> <summary> Depends On </summary> workbookId </details> | | true |
| workbookId | Workbook ID | STRING | The ID of the workbook. | true |
| worksheetName | Worksheet | STRING <details> <summary> Depends On </summary> workbookId </details> | The name of the worksheet. | true |
| isTheFirstRowHeader | Is the First Row Header? | BOOLEAN <details> <summary> Options </summary> <span>true</span>, <span>false</span> </details> | If the first row is header. | true |
| rowNumber | Row Number | INTEGER | The row number to get the values from. | true |

Expand All @@ -207,20 +228,27 @@ The output for this action is dynamic and may vary depending on the input parame



#### Find Workbook ID

To find the Workbook ID, click [here](/reference/components/microsoft-excel_v1#how-to-find-workbook-id).

#### Find Worksheet Name

To find the Worksheet name, click [here](/reference/components/microsoft-excel_v1#how-to-find-worksheet-name).



### Update Row
Name: updateRow

`Update a row in a worksheet.`
`Update a row in an existing worksheet.`

#### Properties

| Name | Label | Type | Description | Required |
|:---------------:|:--------------:|:------------:|:-------------------:|:--------:|
| workbookId | Workbook ID | STRING | | true |
| worksheetName | Worksheet | STRING <details> <summary> Depends On </summary> workbookId </details> | | true |
| workbookId | Workbook ID | STRING | The ID of the workbook. | true |
| worksheetName | Worksheet | STRING <details> <summary> Depends On </summary> workbookId </details> | The name of the worksheet. | true |
| rowNumber | Row Number | INTEGER | The row number to update. | true |
| isTheFirstRowHeader | Is the First Row Header? | BOOLEAN <details> <summary> Options </summary> <span>true</span>, <span>false</span> </details> | If the first row is header. | true |
| updateWholeRow | Update Whole Row | BOOLEAN <details> <summary> Options </summary> <span>true</span>, <span>false</span> </details> | Whether to update the whole row or just specific columns. | true |
Expand Down Expand Up @@ -249,6 +277,60 @@ The output for this action is dynamic and may vary depending on the input parame



#### Find Workbook ID

To find the Workbook ID, click [here](/reference/components/microsoft-excel_v1#how-to-find-workbook-id).

#### Find Worksheet Name

To find the Worksheet name, click [here](/reference/components/microsoft-excel_v1#how-to-find-worksheet-name).




## Triggers


### New Row
Name: newRow

`Triggers when a new row is added.`

Type: POLLING

#### Properties

| Name | Label | Type | Description | Required |
|:---------------:|:--------------:|:------------:|:-------------------:|:--------:|
| workbookId | Workbook ID | STRING | The ID of the workbook. | true |
| worksheetName | Worksheet | STRING <details> <summary> Depends On </summary> workbookId </details> | The name of the worksheet. | true |
| isTheFirstRowHeader | Is the First Row Header? | BOOLEAN <details> <summary> Options </summary> <span>true</span>, <span>false</span> </details> | If the first row is header. | true |


#### Output

The output for this action is dynamic and may vary depending on the input parameters. To determine the exact structure of the output, you need to execute the action.

#### JSON Example
```json
{
"label" : "New Row",
"name" : "newRow",
"parameters" : {
"workbookId" : "",
"worksheetName" : "",
"isTheFirstRowHeader" : false
},
"type" : "microsoftExcel/v1/newRow"
}
```
#### Find Workbook ID

To find the Workbook ID, click [here](/reference/components/microsoft-excel_v1#how-to-find-workbook-id).

#### Find Worksheet Name

To find the Worksheet name, click [here](/reference/components/microsoft-excel_v1#how-to-find-worksheet-name).



Expand All @@ -260,3 +342,15 @@ If this component doesn't have the action you need, you can use **Custom Action*

To create a Custom Action, simply specify the desired HTTP method, path, and any necessary parameters. This way, you can extend the functionality of your component beyond the predefined actions, ensuring that you can meet all your integration needs effectively.

<hr />

# Additional Instructions

### How to find Workbook ID

#### Via API
Use the `GET https://graph.microsoft.com/v1.0/me/drive/items/root/search(q='.xlsx')` endpoint.

### How to find Worksheet Name

To find a Worksheet Name, open the workbook. Below the worksheet you will find a bar with worksheet names.
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
import com.bytechef.component.microsoft.excel.action.MicrosoftExcelFindRowByNumAction;
import com.bytechef.component.microsoft.excel.action.MicrosoftExcelUpdateRowAction;
import com.bytechef.component.microsoft.excel.connection.MicrosoftExcelConnection;
import com.bytechef.component.microsoft.excel.trigger.MicrosoftExcelNewRowTrigger;
import com.google.auto.service.AutoService;

/**
Expand All @@ -42,6 +43,9 @@ public class MicrosoftExcelComponentHandler implements ComponentHandler {
"Microsoft Excel is a spreadsheet program used for organizing, analyzing, and visualizing data in " +
"tabular form.")
.customAction(true)
.customActionHelp(
"",
"https://learn.microsoft.com/en-us/graph/api/resources/excel?view=graph-rest-1.0")
.icon("path:assets/microsoft-excel.svg")
.categories(ComponentCategory.PRODUCTIVITY_AND_COLLABORATION)
.connection(MicrosoftExcelConnection.CONNECTION_DEFINITION)
Expand All @@ -56,7 +60,9 @@ public class MicrosoftExcelComponentHandler implements ComponentHandler {
tool(MicrosoftExcelClearWorksheetAction.ACTION_DEFINITION),
tool(MicrosoftExcelDeleteRowAction.ACTION_DEFINITION),
tool(MicrosoftExcelFindRowByNumAction.ACTION_DEFINITION),
tool(MicrosoftExcelUpdateRowAction.ACTION_DEFINITION));
tool(MicrosoftExcelUpdateRowAction.ACTION_DEFINITION))
.triggers(MicrosoftExcelNewRowTrigger.TRIGGER_DEFINITION)
.version(1);

@Override
public ComponentDefinition getDefinition() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ public class MicrosoftExcelAppendRowAction {
public static final ModifiableActionDefinition ACTION_DEFINITION = action("appendRow")
.title("Append Row")
.description("Append a row of values to an existing worksheet.")
.help("", "https://docs.bytechef.io/reference/components/microsoft-excel_v1#append-row")
.properties(
WORKBOOK_ID_PROPERTY,
WORKSHEET_NAME_PROPERTY,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,10 @@

import com.bytechef.component.definition.ComponentDsl.ModifiableActionDefinition;
import com.bytechef.component.definition.Context;
import com.bytechef.component.definition.Context.Http;
import com.bytechef.component.definition.Context.Http.Body;
import com.bytechef.component.definition.Parameters;
import com.bytechef.microsoft.commons.MicrosoftUtils;
import java.util.List;
import java.util.Map;

/**
* @author Monika Kušter
Expand All @@ -41,6 +41,7 @@ public class MicrosoftExcelClearWorksheetAction {
public static final ModifiableActionDefinition ACTION_DEFINITION = action("clearWorksheet")
.title("Clear Worksheet")
.description("Clear a worksheet of all values.")
.help("", "https://docs.bytechef.io/reference/components/microsoft-excel_v1#clear-worksheet")
.properties(
WORKBOOK_ID_PROPERTY,
WORKSHEET_NAME_PROPERTY,
Expand All @@ -63,10 +64,7 @@ public static Object perform(Parameters inputParameters, Parameters connectionPa
.formatted(
inputParameters.getRequiredString(WORKBOOK_ID),
inputParameters.getRequiredString(WORKSHEET_NAME), range)))
.configuration(Http.responseType(Http.ResponseType.JSON))
.body(Http.Body.of(
List.of("applyTo", "Contents")
.toArray()))
.body(Body.of(Map.of("applyTo", "Contents")))
.execute();

return null;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,10 @@

import com.bytechef.component.definition.ComponentDsl.ModifiableActionDefinition;
import com.bytechef.component.definition.Context;
import com.bytechef.component.definition.Context.Http;
import com.bytechef.component.definition.Context.Http.Body;
import com.bytechef.component.definition.Parameters;
import com.bytechef.microsoft.commons.MicrosoftUtils;
import java.util.List;
import java.util.Map;

/**
* @author Monika Domiter
Expand All @@ -40,6 +40,7 @@ public class MicrosoftExcelDeleteRowAction {
public static final ModifiableActionDefinition ACTION_DEFINITION = action("deleteRow")
.title("Delete Row")
.description("Delete row on an existing sheet.")
.help("", "https://docs.bytechef.io/reference/components/microsoft-excel_v1#delete-row")
.properties(
WORKBOOK_ID_PROPERTY,
WORKSHEET_NAME_PROPERTY,
Expand All @@ -61,11 +62,10 @@ public static Object perform(Parameters inputParameters, Parameters connectionPa
context.http(http -> http
.post(
"/me/drive/items/%s/workbook/worksheets/%s/range(address='%s')/delete"
.formatted(inputParameters.getRequiredString(WORKBOOK_ID),
.formatted(
inputParameters.getRequiredString(WORKBOOK_ID),
inputParameters.getRequiredString(WORKSHEET_NAME), range)))
.configuration(Http.responseType(Http.ResponseType.JSON))
.body(Http.Body.of(List.of("shift", "Up")
.toArray()))
.body(Body.of(Map.of("shift", "Up")))
.execute();

return null;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ public class MicrosoftExcelFindRowByNumAction {
public static final ModifiableActionDefinition ACTION_DEFINITION = action("findRowByNum")
.title("Find Row by Number")
.description("Get row values from the worksheet by the row number.")
.help("", "https://docs.bytechef.io/reference/components/microsoft-excel_v1#find-row-by-num")
.properties(
WORKBOOK_ID_PROPERTY,
WORKSHEET_NAME_PROPERTY,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,8 @@ public class MicrosoftExcelUpdateRowAction {

public static final ModifiableActionDefinition ACTION_DEFINITION = action("updateRow")
.title("Update Row")
.description("Update a row in a worksheet.")
.description("Update a row in an existing worksheet.")
.help("", "https://docs.bytechef.io/reference/components/microsoft-excel_v1#update-row")
.properties(
WORKBOOK_ID_PROPERTY,
WORKSHEET_NAME_PROPERTY,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,11 +49,13 @@ public class MicrosoftExcelConstants {

public static final ModifiableStringProperty WORKBOOK_ID_PROPERTY = string(WORKBOOK_ID)
.label("Workbook ID")
.description("The ID of the workbook.")
.options((OptionsFunction<String>) MicrosoftExcelUtils::getWorkbookIdOptions)
.required(true);

public static final ModifiableStringProperty WORKSHEET_NAME_PROPERTY = string(WORKSHEET_NAME)
.label("Worksheet")
.description("The name of the worksheet.")
.options((OptionsFunction<String>) MicrosoftExcelUtils::getWorksheetNameOptions)
.optionsLookupDependsOn(WORKBOOK_ID)
.required(true);
Expand Down
Loading
Loading