# Configuration guide: Schedule online meetings in Outlook

{% hint style="warning" %}
The configuration options on this page are only accessible to [administrators](/platform/user-guide/administration/account-management/roles.md).

Refer to the [Usage guide: Schedule online meetings in Outlook](/platform/library-packs/l1-support/workflow-schedule-online-meeting-outlook/usage-guide-proactive-password-reset.md) to use library content as a standard user.
{% endhint %}

## Prerequisites <a href="#pre-requisites" id="pre-requisites"></a>

This library pack contains content from the following [expansion products](/platform/overview/products.md)

* [Flow - Workflows](/platform/user-guide/workflows.md)

{% hint style="info" %}
Some of these products offer default access to their respective content and can still be used without [expansion products](/platform/overview/products.md).

To learn more about default thresholds for expansion products, [visit the extended documentation](broken://spaces/OrWF1QMMEwqZgv33QBkR).
{% endhint %}

## **Included content and dependencies** <a href="#content-and-dependency" id="content-and-dependency"></a>

This library pack contains the following content and dependencies:

<table><thead><tr><th width="219">Type</th><th width="235">Name</th><th>Description</th></tr></thead><tbody><tr><td><a href="https://docs.nexthink.com/platform/user-guide/workflows">Workflows</a></td><td><strong>Schedule online meetings in Outlook</strong></td><td>Workflow for scheduling online meetings in Outlook calendar.</td></tr></tbody></table>

## Configuring Schedule online meetings in Outlook pack <a href="#configuration" id="configuration"></a>

{% hint style="info" %}
Adapt these suggested configuration steps to edit and customize content according to your organizational needs.
{% endhint %}

Follow these steps to install and configure content:

* Before configuration - Install library pack content from [Nexthink Library](/platform/user-guide/nexthink-library.md)
* [Step 1 - Set up a registered Microsoft Entra ID app and configure Microsoft Graph API connector credentials](#step-2-set-up-a-registered-microsoft-entra-id-app-and-configure-microsoft-graph-api-connector-creden)
* [Step 2 - Configure global parameters](#step-3-configure-global-parameters)
* [Step 3 - Examine the custom JavaScript code of the Functions thinklets](#step-3-examine-the-custom-javascript-code-of-the-functions-thinklets)

### Step 1 - Set up a registered Microsoft Entra ID app and configure Microsoft Graph API connector credentials <a href="#step-2-set-up-a-registered-microsoft-entra-id-app-and-configure-microsoft-graph-api-connector-creden" id="step-2-set-up-a-registered-microsoft-entra-id-app-and-configure-microsoft-graph-api-connector-creden"></a>

Refer to the following documentation page to register the Microsoft Entra ID application and configure the appropriate connector credentials in Nexthink: [Entra ID integration for workflows](/platform/library-packs/faq/entra-id-integration-for-workflows.md).

For this workflow, the registered Entra ID application must be granted the following permissions:

| Permission type | Least privileged permissions |
| --------------- | ---------------------------- |
| Application     | Calendars.ReadWrite          |

{% hint style="info" %}
This workflow has been tested using the Application permission type. Different environments require different permissions. You should assign permissions according to your environment and know the risks involved.
{% endhint %}

Refer to the Graph REST API documentation from Microsoft for more information:

* [Graph REST API documentation - GetSchedule](https://learn.microsoft.com/en-us/graph/api/calendar-getschedule?view=graph-rest-1.0\&tabs=http)
* [Graph REST API documentation - CreateEvent](https://learn.microsoft.com/en-us/graph/api/user-post-events?view=graph-rest-1.0\&tabs=http)

### Step 2 -Configure global parameters <a href="#step-3-configure-global-parameters" id="step-3-configure-global-parameters"></a>

There are the following global parameters in this workflow:

* Timezone
* Participant
* Subject
* Content
* meetingDurationMinutes
* Location

The table below outlines the purpose and default value of each parameter.

| Name                   | Default value                | Description                                                     |
| ---------------------- | ---------------------------- | --------------------------------------------------------------- |
| Timezone               | Central Europe Standard Time | Name of the time zone                                           |
| Participant            | N/A                          | Email address of the participant                                |
| Subject                | Appointment                  | This text would appear in the subject field of the meeting.     |
| Content                | Meeting description          | This text would appear in the description field of the meeting. |
| meetingDurationMinutes | 60                           | The duration of the meeting is in minutes.                      |
| Location               | Default location             | This text would appear in the location field of the meeting.    |

### Step 3 - Examine the custom JavaScript code of the Functions thinklets

#### 'Start and End date' function

The thinklet contains the following custom JavaScript code:

```
function nextBusinessDay(fromDate = new Date()) {
    const nextDay = new Date(fromDate);
    do {
        nextDay.setDate(nextDay.getDate() + 1);
    } while ([0, 6].includes(nextDay.getDay()));
    return nextDay;
}

function toLocalISOString(date, offsetHours = 0, offsetMinutes = 0) {
    const offsetDate = new Date(date);
    offsetDate.setHours(offsetHours, offsetMinutes, 0, 0);

    // Build timedate string: 'YYYY-MM-DDTHH:MM:SS'
    return offsetDate.getFullYear() +
        '-' + String(offsetDate.getMonth() + 1).padStart(2, '0') +
        '-' + String(offsetDate.getDate()).padStart(2, '0') +
        'T' + String(offsetDate.getHours()).padStart(2, '0') +
        ':' + String(offsetDate.getMinutes()).padStart(2, '0') +
        ':00';
}

const nextDay = nextBusinessDay();
outputs.start = toLocalISOString(nextDay, 9);   
outputs.end = toLocalISOString(nextDay, 17);    

nxLogger.log(`Start: ${outputs.start}`);
nxLogger.log(`End: ${outputs.end}`);
```

#### 'Check availability' function

The thinklet contains the following custom JavaScript code:

```
function nextBusinessDay(fromDate = new Date()) {
    const nextDay = new Date(fromDate);
    do {
        nextDay.setDate(nextDay.getDate() + 1);
    } while ([0, 6].includes(nextDay.getDay()));
    return nextDay;
}

function toLocalISOString(date, offsetHours = 0, offsetMinutes = 0) {
    const offsetDate = new Date(date);
    offsetDate.setHours(offsetHours, offsetMinutes, 0, 0);

    // Build timedate string: 'YYYY-MM-DDTHH:MM:SS'
    return offsetDate.getFullYear() +
        '-' + String(offsetDate.getMonth() + 1).padStart(2, '0') +
        '-' + String(offsetDate.getDate()).padStart(2, '0') +
        'T' + String(offsetDate.getHours()).padStart(2, '0') +
        ':' + String(offsetDate.getMinutes()).padStart(2, '0') +
        ':00';
}

const nextDay = nextBusinessDay();
outputs.start = toLocalISOString(nextDay, 9);   
outputs.end = toLocalISOString(nextDay, 17);    

nxLogger.log(`Start: ${outputs.start}`);
nxLogger.log(`End: ${outputs.end}`);
```

***

RELATED TOPICS

* [Workflow: Schedule online meetings in Outlook](/platform/library-packs/l1-support/workflow-schedule-online-meeting-outlook.md)
* [Usage guide: Schedule online meetings in Outlook](/platform/library-packs/l1-support/workflow-schedule-online-meeting-outlook/usage-guide-proactive-password-reset.md)
* [Manage Workflows](https://docs.nexthink.com/platform/user-guide/workflows/managing-workflows)


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.nexthink.com/platform/library-packs/l1-support/workflow-schedule-online-meeting-outlook/configuration-guide-proactive-password-reset.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
