cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
DanielRK
Super User
Super User

How do I get a teams ID and teams channel ID dynamically from a sharepoint list and set a variable with it?

Hi,

 

I have multiple teams sharing one SP list which is filtered per team and mapped into the respective teams as a list tab in the general channel where the users of that team can see only the items created by that team.

 

I'm trying to build a teams notification flow where there have been no records created in a sharepoint list in the last seven days.

 

If there have been no items created in the SP list in the last 7 days, a notification must be sent out to the respective team and channel dynamically to inform that team that they must create items in the list.

 

I've used one sharepoint list and tagged each item with the name of the team it belongs to (Team column). The list has been mapped to the respective teams general channel as a list tab but filtered to show only the items for that team. Team A see's the list showing only items for Team A, Team B is the same and so on.

 

I have a 'helper list' where the title is the team name (same as the main SP list team column) and have the team ID and channel ID listed in the next two columns.

 

In the flow I've initialized separate variables for the team ID and channel ID which I will later set the values for and reference in the teams flow bot fields that requires the teams and channel IDs.

 

Firstly, how will I get the dynamic team and channel ID from that 'helper list' for each team that has not had any items created in the last seven days so the notification can be sent to those teams?

 

Secondly, how do I map the dynamic teams and channel ids to the 'set variable' actions?

 

Thirdly, do I need to put the above actions inside of an apply to each loop so it send notifications to each team that hasn't had any items in the last 7 days?

 

I'm lost in terms of how to approach this. If there is a simpler way by designing it differently I'm all ears.

 

Please help! Thank you

 

DanielRK_0-1614196188024.png

 

DanielRK_1-1614196194059.png

 

DanielRK_2-1614196199442.png

 

2 REPLIES 2
mahoneypat
Solution Sage
Solution Sage

One alternate approach might be to start with an array with your Team names (SharePoint column values) and the notification distribution list for each.  You could then get SharePoint list items filtered on created date in last 7 days.  You could then iterate through the array and count the # of items present for each team (filter the get items array for the team in the current iteration).  Inside that Apply To Each, you would trigger a notification email to the dist list for that row if the count of filtered items not >=1 (or is empty).

Pat





Did I answer your question? Mark my post as a solution! Kudos are also appreciated!

To learn more about the Power Platform, follow me on Twitter or subscribe on YouTube.


@mahoneypa HoosierBI on YouTube


Hi Pat,

 

Thank you for taking the time to help me. I appreciate it. I will give it a try.

 

Best,

 

Daniel

Helpful resources

Announcements
Power Platform Conf 2022 768x460.jpg

Join us for Microsoft Power Platform Conference

The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.

New Ideas Forum MPA.jpg

A new place to submit your Ideas for Power Automate

Announcing a new way to share your feedback with the Power Automate Team.

MPA Virtual Workshop Carousel 768x460.png

Register for a Free Workshop

Learn to digitize and optimize business processes and connect all your applications to share data in real time.

MPA Licensing.jpg

Ask your licensing questions at the Power Automate AMA!

Join Priya Kodukula and the licensing team, super users and MVPs to find answers to your questions on Power Automate licensing.

Users online (3,850)