Skip to content

Commit ecc4310

Browse files
authored
[excel] (Samples) Fix CSV regex and punch clock button labels (#711)
* Fix CSV regex and punch clock button labels * Fix link * Revert to old regex
1 parent 9398f37 commit ecc4310

File tree

4 files changed

+7
-7
lines changed

4 files changed

+7
-7
lines changed

docs/images/punch-clock-sample-2.png

1.11 KB
Loading

docs/images/punch-clock-sample-3.png

-17.6 KB
Binary file not shown.

docs/resources/samples/convert-csv.md

Lines changed: 3 additions & 1 deletion
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/17/2024
4+
ms.date: 02/07/2024
55
ms.localizationpriority: medium
66
---
77

@@ -34,7 +34,9 @@ function main(workbook: ExcelScript.Workbook, csv: string) {
3434
csv = csv.replace(/\r/g, "");
3535

3636
// Split each line into a row.
37+
// NOTE: This will split values that contain new line characters.
3738
let rows = csv.split("\n");
39+
3840
/*
3941
* For each row, match the comma-separated sections.
4042
* For more information on how to use regular expressions to parse CSV files,

docs/resources/scenarios/punch-clock.md

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
title: 'Office Scripts sample scenario: Punch clock button'
33
description: This sample adds a punch clock button and allows a user to clock in and clock out using the current time.
4-
ms.date: 10/01/2022
4+
ms.date: 02/07/2024
55
ms.localizationpriority: medium
66
---
77

@@ -11,7 +11,7 @@ The scenario idea and script used in this sample was contributed by Office Scrip
1111

1212
In this scenario, you'll create a time sheet for an employee that allows them to record their start and end times with a [button](../../develop/script-buttons.md). Based on what's previously been recorded, selecting the button will either start their day (clock in) or end their day (clock out).
1313

14-
:::image type="content" source="../../images/punch-clock-sample-3.png" alt-text="A table with three columns ('Clock In', 'Clock Out', and 'Duration') and a button labeled 'Punch clock' in the workbook.":::
14+
:::image type="content" source="../../images/punch-clock-sample-2.png" alt-text="A table with three columns ('Clock In', 'Clock Out', and 'Duration') and a button labeled 'Punch clock' in the workbook.":::
1515

1616
## Setup instructions
1717

@@ -122,17 +122,15 @@ In this scenario, you'll create a time sheet for an employee that allows them to
122122

123123
1. In the workbook, select cell **E2**.
124124

125-
1. Add a script button. Go to the **More options (…)** menu in the **Script details** page and select **Add button**.
126-
127-
:::image type="content" source="../../images/punch-clock-sample-2.png" alt-text="The 'More options' menu and the 'Add button' button.":::
125+
1. Add a script button. Go to the **More options (…)** menu in the **Script details** page and select **Add in workbook**.
128126

129127
1. Save the workbook.
130128

131129
## Run the script
132130

133131
Select the **Punch clock** button to run the script. It either logs the current time under "Clock In" or "Clock Out", depending on what was previously entered.
134132

135-
:::image type="content" source="../../images/punch-clock-sample-3.png" alt-text="The table and the 'Punch clock' button in the workbook.":::
133+
:::image type="content" source="../../images/punch-clock-sample-2.png" alt-text="The table and the 'Punch clock' button in the workbook.":::
136134

137135
> [!NOTE]
138136
> The duration is only recorded if it's longer than a minute. Manually edit the "Clock In" time to test larger durations.

0 commit comments

Comments
 (0)