cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
MelB10
Frequent Visitor

How to remove users from my Sharepoint list that are no longer found in 0365 database using Power Automate

I have a Sharepoint list that holds members of a Teams Channel and updates when a new member joins. How can I create a flow that updates my Sharepoint list to show that this member no longer exists as they have either left the Teams channel or the company.

2 ACCEPTED SOLUTIONS

Accepted Solutions
v-chenzhi
Community Support
Community Support

Hi @MelB10 ,

 

Do you want to remove the items (If this email cannot be found by Get user profilesV2, then delete it)?

Please try the following workaround.

I create a column type of text.

vchenzhi_1-1638348567846.png

vchenzhi_2-1638348830618.png

result('Scope')[0]['status']

vchenzhi_3-1638348922953.png

vchenzhi_4-1638349052399.png

 

 

Best Regards,

Zhi Chen

 

 

 

 

View solution in original post

MelB10
Frequent Visitor

Thank you, your solution works perfectly! Much appreciated. 

View solution in original post

5 REPLIES 5
v-chenzhi
Community Support
Community Support

Hi @MelB10 ,

 

Do you want to delete the items without cations in O365?

Could you please tell me the type of columns in SharePoint?

I assume you have a column named TTPerson type of Person.

vchenzhi_6-1636970732200.png

Here is the flow.

vchenzhi_7-1636970732204.png

vchenzhi_9-1636970852455.png

Here is the expression:

result('123')[0]['status']

vchenzhi_8-1636970732204.png

 

 

Best Regards,

Zhi Chen

MelB10
Frequent Visitor

Thank you so much for your response @v-chenzhi 

 

I'll try this and let you know how it goes.

Regarding  the TTP, I have a title field that shows the users email address. 

 

I added a column that has a yes/no choice to test if its working correctly as I was worried to just delete but perhaps I'll set up a test SP list as you've shown and do it this way.

 

Thanks again. 

MelB10
Frequent Visitor

Hello @v-chenzhi, I don't have a column called TTPerson. I would like to remove users that are invalid when searched for through 0365, (as they have left the company).

The Expression
"result('123')[0]['status']" will therefore not work as my columns are not set up this way. 

These are the type of columns I have currently:
Title (Email Address)
Microsoft Teams Member (Yes/No Column)
Joined MS Teams (Date Column)
Left MS Teams (Date Column)

Thank you.

v-chenzhi
Community Support
Community Support

Hi @MelB10 ,

 

Do you want to remove the items (If this email cannot be found by Get user profilesV2, then delete it)?

Please try the following workaround.

I create a column type of text.

vchenzhi_1-1638348567846.png

vchenzhi_2-1638348830618.png

result('Scope')[0]['status']

vchenzhi_3-1638348922953.png

vchenzhi_4-1638349052399.png

 

 

Best Regards,

Zhi Chen

 

 

 

 

MelB10
Frequent Visitor

Thank you, your solution works perfectly! Much appreciated. 

Helpful resources

Announcements
Power Automate News & Announcements

Power Automate News & Announcements

Keep up to date with current events and community announcements in the Power Automate community.

Community Calls Conversations

Community Calls Conversations

A great place where you can stay up to date with community calls and interact with the speakers.

Power Automate Community Blog

Power Automate Community Blog

Check out the latest Community Blog from the community!

Top Solution Authors
Top Kudoed Authors
Users online (3,644)