Skip to content

Commit fe85458

Browse files
authored
Merge pull request #608 from OfficeDev/main
[admin] Publish
2 parents 96426c7 + cdd18ce commit fe85458

File tree

4 files changed

+21
-3
lines changed

4 files changed

+21
-3
lines changed

docs/develop/use-json.md

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -203,6 +203,24 @@ interface Transaction {
203203
204204
:::image type="content" source="../images/create-json-console-output.png" alt-text="The console output from the previous script that shows the property values of the object.":::
205205
206+
### Export JSON with `fetch`
207+
208+
Much like importing data with `fetch`, you can send data from your workbook with a similar command. A `POST` command takes any stringified JSON data and sends it to the specified endpoint.
209+
210+
To see this in action, replace the `console.log(transactions);` line in the previous sample with the following code. This issues a `POST` command to a testing server, then reads the data back.
211+
212+
```typescript
213+
const response = await fetch('https://jsonplaceholder.typicode.com/posts', {
214+
method: 'POST',
215+
body: JSON.stringify(transactions),
216+
headers: {
217+
'Content-type': 'application/json; charset=UTF-8',
218+
},
219+
});
220+
const jsonData: object[] = await response.json();
221+
console.log(jsonData);
222+
```
223+
206224
### Use a generic object
207225
208226
The previous sample assumes the table header values are consistent. If your table has variable columns, you'll need to create a generic JSON object. The following script shows a script that logs any table as JSON.

docs/includes/platform-requirements.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
To use Office Scripts, you'll need the following.
22

33
1. Excel for Windows (version 2210 or higher), Excel for Mac, or Excel on the web.
4-
*The [Action Recorder](../overview/excel.md#action-recorder) is only partially available on Windows and Mac. It is being gradually rolled out to wider audiences over the coming weeks.*
4+
*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).*
55
1. OneDrive for Business.
66
1. Any commercial or educational Microsoft 365 license with access to the Microsoft 365 Office desktop apps, such as:
77
- Office 365 Business

docs/overview/excel.md

Lines changed: 1 addition & 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: 03/27/2023
5+
ms.date: 04/11/2023
66
ms.localizationpriority: high
77
---
88

docs/testing/platform-limits.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
title: Platform limits and requirements with Office Scripts
33
description: Resource limits and browser support for Office Scripts when used with Excel.
44
ms.topic: limits-and-quotas
5-
ms.date: 03/10/2023
5+
ms.date: 04/11/2023
66
ms.localizationpriority: medium
77
---
88

0 commit comments

Comments
 (0)