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

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / Extract Work Location ...
Power Automate
Unanswered

Extract Work Location from Microsoft Teams and store it in Excel

(0) ShareShare
ReportReport
Posted on by 986
Hi everyone,
I have designed a scheduled flow that creates an Excel file which team members to fill their work mode (WFO/WFH). For team members details like Employee Name, Employee Email these details I am extracting using the Microsoft Teams action that's available in Power Automate i.e. 'List members action', so the flow structure looks like this:


This flow creates a file like:

As you can see the structure in above picture.
So this works but I was thinking whether it is possible to the Work Location that is introduced by Microsoft in teams app/teams desktop where users set their work location : Remote/Office


So currently the flow that I have designed runs (scheduled flow) every Monday morning around 9:30 am, but I was thinking if are able to extract the Work location then every weekday (Monday to Friday) morning around 10/11 am I want to run the flow and check the Work location for every user present in the Teams group and accordingly use that value and fill that for the respective day, so is it possible to do that?
 
//The expression that adds the details that I mentioned earlier like Employee Name, Email
{
  "SNo": "@{variables('varCounter')}",
  "Employee Name": "@{items('Add_Team_Member_to_Excel')?['displayName']}",
  "Employee Email": @{items('Add_Team_Member_to_Excel')?['email']},
  "@{split(outputs('Header'),',')[3]}": "@{if(contains(join(body('Select'),', '),
   concat(' ',split(outputs('Header'),',')[3])),'Holiday',if(contains(variables('WFOMembers'),
   items('Add_Team_Member_to_Excel')?['email']),'WFO',''))}",
  "@{split(outputs('Header'),',')[4]}": "@{if(contains(join(body('Select'),', '),
   concat(' ',split(outputs('Header'),',')[4])),'Holiday',if(contains(variables('WFOMembers'),
   items('Add_Team_Member_to_Excel')?['email']),'WFO',''))}",
  "@{split(outputs('Header'),',')[5]}": "@{if(contains(join(body('Select'),', '),
   concat(' ',split(outputs('Header'),',')[5])),'Holiday',if(contains(variables('WFOMembers'),
   items('Add_Team_Member_to_Excel')?['email']),'WFO',''))}",
  "@{split(outputs('Header'),',')[6]}": "@{if(contains(join(body('Select'),', '),
   concat(' ',split(outputs('Header'),',')[6])),'Holiday',if(contains(variables('WFOMembers'),
   items('Add_Team_Member_to_Excel')?['email']),'WFO',''))}",
  "@{split(outputs('Header'),',')[7]}": "@{if(contains(join(body('Select'),', '),
   concat(' ',split(outputs('Header'),',')[7])),'Holiday',
   if(contains(variables('WFOMembers'),items('Add_Team_Member_to_Excel')?['email']),'WFO',''))}"
}

//Also I have a Holiday List which mentions the Holidays for the current calendar year so in the above
expression a check is been done if the date is match with any of the dates in the Holiday list if yes
then just append 'Holiday' for that particular date column else check if that particular user email
is part of WFOMembers array list if yes: then append WFO else leave it blank

//For weekdays I have mentioned a compose action at the start of the flow (named Headers)

SNo, Employee Name, Employee Email, @{string(formatDateTime(utcNow(),'d/M/yyyy'))},
@{string(formatDateTime(addDays(utcNow(),1),'d/M/yyyy'))},
@{string(formatDateTime(addDays(utcNow(),2),'d/M/yyyy'))},
@{string(formatDateTime(addDays(utcNow(),3),'d/M/yyyy'))},
@{string(formatDateTime(addDays(utcNow(),4),'d/M/yyyy'))}

If you need any more information do let me know.

Regards,
Sidhant.
Categories:
I have the same question (0)

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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the June Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Automate

#1
David_MA Profile Picture

David_MA 267 Super User 2026 Season 1

#2
11manish Profile Picture

11manish 196

#3
Haque Profile Picture

Haque 182

Last 30 days Overall leaderboard