Configuration guide: Schedule online meetings in Outlook

Prerequisites

This library pack contains content from the following expansion products

Some of these products offer default access to their respective content and can still be used without expansion products.

To learn more about default thresholds for expansion products, visit the extended documentation.

Included content and dependencies

This library pack contains the following content and dependencies:

Type
Name
Description

Schedule online meetings in Outlook

Workflow for scheduling online meetings in Outlook calendar.

Configuring Schedule online meetings in Outlook pack

Adapt these suggested configuration steps to edit and customize content according to your organizational needs.

Follow these steps to install and configure content:

Step 1 - Set up a registered Microsoft Entra ID app and configure Microsoft Graph API connector credentials

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.

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

Permission type
Least privileged permissions

Application

Calendars.ReadWrite

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.

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

Step 2 -Configure global parameters

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

Last updated

Was this helpful?