web
You’re offline. This is a read only version of the page.
close
Skip to main content
Community site session details

Community site session details

Session Id : r3zGzhgDZc4rYOkDMSjdHU
Power Automate - Building Flows
Answered

Creating Teams Meetings from Excel Spreadsheet

Like (0) ShareShare
ReportReport
Posted on 30 Oct 2020 14:49:53 by 2

I am looking to create individual team meetings with data from an excel spreadsheet. 

 

My table looks like this: 

VWilliamson_0-1604068970310.png

 

So, I've built a flow to read the rows, however it will not read the date and time correctly as it is reading it as text. I've spent HOURS trying to convert but, having read many forums and watching youtube, I'm not getting any closer.

 

At what stage do I convert the date and time, how do I convert it and how do I put the result into the meeting timeslots?

 

VWilliamson_1-1604069312678.png

 

I have the same question (0)
  • Nasser28 Profile Picture
    2 on 23 Oct 2022 at 05:38:42
    Re: Creating Teams Meetings from Excel Spreadsheet

    Hello, Thank you for your post
    on the function :

    function returnObjectFromValues(values: string[][]): MeetingDetail[] {
     let objArray = [];

    the variable  objArray type is not declared, 

     Office Scripts cannot infer the data type of this variable. Please declare a type for the variable.

    if I declared it as a string, it shows

    let objArray: string[] ;
    undefined
     


    Thank you for helping me, I'm beginner 

  • sumurthy Profile Picture
    Microsoft Employee on 06 Nov 2020 at 19:06:06
    Re: Creating Teams Meetings from Excel Spreadsheet

    @VWilliamson 

    I made a video of the solution here if you like to see - https://github.com/sumurthy/officescripts-projects/tree/main/Excel%20and%20Teams%20Invite

     

    I want to alert you about an issue I noticed around dates. 

    There could be a mis-match between time-zone in Excel and 

  • sumurthy Profile Picture
    Microsoft Employee on 30 Oct 2020 at 22:00:10
    Re: Creating Teams Meetings from Excel Spreadsheet

    For the above response, use this script 

    function main(workbook: ExcelScript.Workbook): MeetingDetail[] {
     const sheet = workbook.getWorksheet('Sheet8');
     const table = sheet.getTables()[0];
     table.getColumnByName('Start time').getRangeBetweenHeaderAndTotal().setNumberFormatLocal("[$-en-US]m/d/yyyy h:mm AM/PM;@");
     table.getColumnByName('Finish time').getRangeBetweenHeaderAndTotal().setNumberFormatLocal("[$-en-US]m/d/yyyy h:mm AM/PM;@");
     const dataRows: (string | number | boolean)[][] = table.getRange().getTexts();
     // or
     // let dataRows = sheet.getUsedRange().getValues();
     const selectedRows = dataRows.filter((row, i) => {
     // Select header row and any data row with the status column equal to approach value
     return (row[1] === 'FALSE' || i === 0)
     })
     const output: MeetingDetail[] = returnObjectFromValues(selectedRows as string[][]);
     return output;
    }
    
    /**
     * This helper funciton converts table values into an object array.
     */
    function returnObjectFromValues(values: string[][]): MeetingDetail[] {
     let objArray = [];
     let objKeys: string[] = [];
     for (let i = 0; i < values.length; i++) {
     if (i === 0) {
     objKeys = values[i]
     continue;
     }
     let obj = {}
     for (let j = 0; j < values[i].length; j++) {
     obj[objKeys[j]] = values[i][j]
     }
     objArray.push(obj);
     }
     console.log(JSON.stringify(objArray));
     return objArray as MeetingDetail[];
    }
    
    interface BasicObj {
     [key: string]: string | number | boolean
    }
    
    interface MeetingDetail extends BasicObj {
     'ID': string
     'Invite to interview': string
     'Candidate': string
     'Candidate email': string
     'Interviewer1': string
     'Interviewer1 email': string
     'Interviewer2': string
     'Interviewer2 email': string
     'Interviewer3': string
     'Interviewer3 email': string
     'Start time': string
     'Finish time': string
    }

     

    Output

    [{
    	"ID": "10",
    	"Invite to interview": "FALSE",
    	"Candidate": "Adele ",
    	"Candidate email": "Adele@mail",
    	"Interviewer1": "Vance",
    	"Interviewer1 email": "Vance@mail",
    	"Interviewer2": "Debra ",
    	"Interviewer2 email": "Debra@mail",
    	"Interviewer": "Berger",
    	"Interviewer3 email": "Berger@mail",
    	"Start time": "10/30/2020 2:00 PM",
    	"Finish time": "10/30/2020 2:30 PM"
    }, {
    	"ID": "30",
    	"Invite to interview": "FALSE",
    	"Candidate": "Allan ",
    	"Candidate email": "Allan@mail",
    	"Interviewer1": "Deyoung",
    	"Interviewer1 email": "Deyoung@mail",
    	"Interviewer2": "Diego ",
    	"Interviewer2 email": "Diego@mail",
    	"Interviewer": "Siciliani",
    	"Interviewer3 email": "Siciliani@mail",
    	"Start time": "10/30/2020 3:30 PM",
    	"Finish time": "10/30/2020 4:00 PM"
    }]
  • Verified answer
    sumurthy Profile Picture
    Microsoft Employee on 30 Oct 2020 at 21:52:13
    Re: Creating Teams Meetings from Excel Spreadsheet
    For this scenario you can use Office Scripts, which allows a TypeScript language based script to be run on Excel file stored in OneDrive or SharePoint.
    For your scenario, you'll need the following: 
    1. An Office Script that formats and extracts the array of data you need for Teams meeting action. 
    2. Send the output to Teams meeting (it'll do apply-for-each)
     

    Input

    t2.png

     
    Script
    1. Open Office Script from Excel for web. Paste the script below - 
    scr.png
    2. Create a Flow
    fl.png
     
    scr.png
     
     
    .... answer continued in next post (this editor is buggy; won't let me save scripts)

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

MS.Ragavendar – Community Spotlight

We are honored to recognize Ragavendar Swaminatha Subramanian as our September…

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 736 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 396 Moderator

#3
Power Apps 1919 Profile Picture

Power Apps 1919 339

Last 30 days Overall leaderboard
Loading complete