Skip to content

Commit be1880c

Browse files
authored
Merge pull request #709 from OfficeDev/main
[admin] Publish
2 parents 20359d2 + f9c1d14 commit be1880c

File tree

11 files changed

+154
-42
lines changed

11 files changed

+154
-42
lines changed
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
---
2+
name: Documentation issue
3+
about: Tell us about a problem in the documentation
4+
title: ''
5+
labels: ''
6+
assignees: ''
7+
8+
---
9+
10+
**Article URL**
11+
On what page did you find the problem?
12+
13+
**Describe the problem**
14+
A clear and concise description of what is incorrect, unclear, or missing in the document.
15+
16+
**Screenshots**
17+
If applicable, add screenshots to help explain your problem.
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
---
2+
name: Sample request
3+
about: Which features would you like to see more of?
4+
title: ''
5+
labels: ''
6+
assignees: ''
7+
8+
---
9+
10+
**Describe your scenario**
11+
What is the problem to solve?
12+
13+
**Which APIs or Excel features?**
14+
What should be showcased in the sample? Are there Excel features that need samples to better understand how to use them in scripts?
Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
name: "📄 Feedback control template"
2+
title: "Feedback"
3+
description: >-
4+
⛔ This template is intended for use by the feedback control on the bottom of every page on the
5+
live site. If you aren't using the feedback control, choose one of the other templates.⛔
6+
body:
7+
- type: markdown
8+
attributes:
9+
value: "## 🎁Enter your feedback🎁"
10+
- type: markdown
11+
attributes:
12+
value: Select the issue type, and describe the issue in the text box below. Add as much detail as needed to help us resolve the issue.
13+
- type: dropdown
14+
id: issue-type
15+
attributes:
16+
label: Type of issue
17+
options:
18+
- Typo
19+
- Code doesn't work
20+
- Missing information
21+
- Outdated article
22+
- Other (describe below)
23+
validations:
24+
required: true
25+
- type: textarea
26+
id: userfeedback
27+
validations:
28+
required: true
29+
attributes:
30+
label: Feedback
31+
description: >-
32+
If possible, please provide extended details that will add context and help the team update
33+
the documentation. Additional details may not be useful for typos, grammar, formatting, etc.
34+
For technical or factual errors, please include code snippets and output to show how the
35+
documentation is incorrect.
36+
- type: markdown
37+
attributes:
38+
value: "## 🚧 Article information 🚧"
39+
- type: markdown
40+
attributes:
41+
value: "*Don't modify the following fields*. They are automatically filled in for you. Doing so will disconnect your issue from the affected article. *Don't edit them*."
42+
- type: input
43+
id: pageUrl
44+
validations:
45+
required: true
46+
attributes:
47+
label: Page URL
48+
- type: input
49+
id: contentSourceUrl
50+
validations:
51+
required: true
52+
attributes:
53+
label: Content source URL
54+
- type: input
55+
id: author
56+
validations:
57+
required: true
58+
attributes:
59+
label: Author
60+
description: GitHub Id of the author
61+
- type: input
62+
id: documentVersionIndependentId
63+
validations:
64+
required: true
65+
attributes:
66+
label: Document Id

Issue_Template.md

Lines changed: 0 additions & 19 deletions
This file was deleted.

docs/develop/power-automate-integration.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
title: Run Office Scripts with Power Automate
33
description: How to get Office Scripts for Excel working with a Power Automate workflow.
44
ms.topic: integration
5-
ms.date: 11/29/2023
5+
ms.date: 01/19/2024
66
ms.localizationpriority: medium
77
---
88

@@ -12,6 +12,9 @@ ms.localizationpriority: medium
1212

1313
[!INCLUDE [Power Automate needs a business license](../includes/power-automate-needs-business.md)]
1414

15+
> [!TIP]
16+
> Looking to automatically run a script without connecting to other apps? Use the [Script scheduling](../overview/excel.md#schedule-scripts-to-run-automatically) feature.
17+
1518
## Get started
1619

1720
If you are new to Power Automate, we recommend visiting [Get started with Power Automate](/power-automate/getting-started). There, you can learn more about all the automation possibilities available to you. The documents here focus on how Office Scripts work with Power Automate and how that can help improve your Excel experience.

docs/docfx.json

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@
3939
"uhfHeaderId": "office-scripts",
4040
"searchScope": ["Office Scripts"],
4141
"breadcrumb_path": "/office/dev/scripts/breadcrumb/toc.json",
42-
"feedback_system": "GitHub",
42+
"feedback_system": "OpenSource",
4343
"feedback_github_repo": "OfficeDev/office-scripts-docs",
4444
"feedback_product_url": "/answers/tags/321/office-development",
4545
"ms.suite": "office",
@@ -48,6 +48,10 @@
4848
"ms.topic": "conceptual",
4949
"ms.subservice": "scripts",
5050
"ms.service": "excel",
51+
"open_source_feedback_contributorGuideUrl": "https://github.com/OfficeDev/office-scripts-docs/blob/main/Contributing.md",
52+
"open_source_feedback_issueTitle": "",
53+
"open_source_feedback_issueUrl": "https://github.com/OfficeDev/office-scripts-docs/issues/new?template=3_customer-feedback.yml",
54+
"open_source_feedback_productName": "Office Scripts",
5155
"titleSuffix": "Office Scripts"
5256
},
5357
"fileMetadata": {

docs/images/schedule-a-script.png

10.5 KB
Loading

docs/includes/platform-requirements.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ To use Office Scripts, you'll need the following.
33
# [For business and education](#tab/business)
44

55
1. Excel for Windows (version 2210 or higher), Excel for Mac, or Excel on the web.
6-
- *The [Action Recorder](../overview/excel.md#action-recorder) is not yet available in the [Semi-Annual Enterprise Channel](/deployoffice/updates/overview-update-channels#semi-annual-enterprise-channel-overview).*
76
1. OneDrive for Business.
87
1. Any commercial or educational Microsoft 365 license with access to the Microsoft 365 Office desktop apps, such as:
98
- Office 365 Business

docs/overview/excel.md

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
title: Office Scripts in Excel
33
description: A brief introduction to the Action Recorder and Code Editor for Office Scripts.
44
ms.topic: overview
5-
ms.date: 12/22/2023
5+
ms.date: 01/19/2024
66
ms.localizationpriority: high
77
---
88

@@ -54,6 +54,14 @@ Add buttons that run scripts to help your colleagues discover your valuable solu
5454
> [!NOTE]
5555
> Learn more about how scripts are stored in your OneDrive in [Office Scripts file storage and ownership](script-storage.md).
5656
57+
## Schedule scripts to run automatically
58+
59+
Set your scripts to run every day and keep your workbook up-to-date. Once you have your script, you can set it to automatically run on the workbook at regular intervals. A behind-the-scenes Power Automate flow ensures everything happens, even when the workbook is closed.
60+
61+
To schedule a script, open the script in the Code Editor. Open the **Script scheduling** section and complete the sign in process to Excel through Power Automate. Set how often you want the script to run and select **Create flow** to begin.
62+
63+
:::image type="content" source="../images/schedule-a-script.png" alt-text="The Code Editor task pane that shows the recurrence interval options for scheduling a script.":::
64+
5765
## Connect Office Scripts to Power Automate
5866

5967
[Power Automate](https://make.powerautomate.com/) is a service that helps you create automated workflows between multiple apps and services. Office Scripts can be used in these workflows, giving you control of your scripts outside of the workbook. You can run your scripts on a schedule, trigger them in response to emails, and much more. Visit the [Run Office Scripts with Power Automate](../tutorials/excel-power-automate-manual.md) tutorial to learn the basics of connecting these automation services.

docs/resources/samples/convert-csv.md

Lines changed: 30 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
title: Convert CSV files to Excel workbooks
33
description: Learn how to use Office Scripts and Power Automate to create .xlsx files from .csv files.
4-
ms.date: 01/04/2024
4+
ms.date: 01/17/2024
55
ms.localizationpriority: medium
66
---
77

@@ -43,25 +43,26 @@ function main(workbook: ExcelScript.Workbook, csv: string) {
4343
const csvMatchRegex = /(?:,|\n|^)("(?:(?:"")*[^"]*)*"|[^",\n]*|(?:\n|$))/g
4444
rows.forEach((value, index) => {
4545
if (value.length > 0) {
46-
let row = value.match(csvMatchRegex);
46+
let row = value.match(csvMatchRegex);
4747

48-
// Check for blanks at the start of the row.
49-
if (row[0].charAt(0) === ',') {
50-
row.unshift("");
51-
}
52-
53-
// Remove the preceding comma.
54-
row.forEach((cell, index) => {
55-
row[index] = cell.indexOf(",") === 0 ? cell.substr(1) : cell;
56-
});
57-
58-
// Create a 2D array with one row.
59-
let data: string[][] = [];
60-
data.push(row);
48+
// Check for blanks at the start of the row.
49+
if (row[0].charAt(0) === ',') {
50+
row.unshift("");
51+
}
52+
53+
// Remove the preceding comma and surrounding quotation marks.
54+
row.forEach((cell, index) => {
55+
cell = cell.indexOf(",") === 0 ? cell.substring(1) : cell;
56+
row[index] = cell.indexOf("\"") === 0 && cell.lastIndexOf("\"") === cell.length - 1 ? cell.substring(1, cell.length - 1) : cell;
57+
});
6158

62-
// Put the data in the worksheet.
63-
let range = sheet.getRangeByIndexes(index, 0, 1, data[0].length);
64-
range.setValues(data);
59+
// Create a 2D array with one row.
60+
let data: string[][] = [];
61+
data.push(row);
62+
63+
// Put the data in the worksheet.
64+
let range = sheet.getRangeByIndexes(index, 0, 1, data[0].length);
65+
range.setValues(data);
6566
}
6667
});
6768

@@ -186,3 +187,14 @@ If your file has hundreds of thousands of cells, you could reach the [Excel data
186187
Files with unicode-specific characters, such as accented vowels like `é`, need to be saved with the correct encoding. Power Automate's OneDrive connector file creation defaults to ANSI for .csv files. If you're creating the .csv files in Power Automate, you'll need to add the [byte order mark (BOM)](https://en.wikipedia.org/wiki/Byte_order_mark) before the comma-separated values. For UTF-8, replace the file contents for the write .csv file operation with the expression `concat(uriComponentToString('%EF%BB%BF'), <CSV Input>)` (where `<CSV Input>` is your original CSV data).
187188

188189
Note that this sample doesn't create the .csv files in the flow, so this change needs to happen in your custom part of the flow. You could also read and rewrite the .csv files with the BOM, if you don't control how those files are created.
190+
191+
### Surrounding quotation marks
192+
193+
This sample removes any quotation marks ("") that surround values. These are typically added to comma-separated values to prevent commas in the data from being treated as separation tokens. A .csv file that is opened in Excel, then saved as a .xlsx file, will never have the those quotation marks shown to the reader. If you wish to keep the quotation marks and have them be displayed in the final spreadsheets, replace lines 27-30 of the script with the following code.
194+
195+
```typescript
196+
// Remove the preceding comma.
197+
row.forEach((cell, index) => {
198+
row[index] = cell.indexOf(",") === 0 ? cell.substring(1) : cell;
199+
});
200+
```

0 commit comments

Comments
 (0)