Skip to main content

Notifications

Community site session details

Community site session details

Session Id :
Power Automate - Building Flows
Unanswered

Compare Lastsignedin Array with sharepoint list

(0) ShareShare
ReportReport
Posted on by 2

Hello together, 

after a bunch of workhours i need some help. I try to explain as much as i can, if you dont understand something let me know i will try to explain.

 

Main Goal: Get a Email/Ticket when a User has not signed in for at least 180 days!

Schedule: Every Monday morning

Specials: I want to just get 1 Mail per User per Inactivity. 

 

Thoughts:

1. I get the list of inactive users with a HTTP Request and Graph api (https://graph.microsoft.com/beta/users?$select=displayName,signInActivity

2. Analyse JSON

3. Filter Array with lastSignInDateTime is not NULL

4. Init. Var. "Time now - 180d" Type: String Value: addDays(utcNow(), -180, 'yyyy-MM-ddTHH:mm:ssZ')

5. Filter Array with LastSignInDateTime is less or equal to "Time now - 180"

---- So far so good i get 35 results. Everything is working fine

6. I Create a sharepoint list and for each array create a element with AzureID, Displayname, LastSignInDateTime and a Boolean with Email send?

7. A Second Flow will check the List, send a Email for each element that has the boolean "Email send?" at no and check it to yes

---- Problem 1: If a User is ill for a longer time he gets inactive and we get an Email. If the user is back and active again he needs to be deleted from the list. I tried to compare the ID in the Sharepointlist with the ID in the Array but i cant select the ID of the Object.

----Problem 2: If i compare array with array i have 935 Users Total. So if i would create a sharepointlist with all Users and compare them together it would be 935*935 = 874.225 Requests that would take weeks until its done.

----Problem 3: If i compane the array with array i cant delete a List element because it is an object instead of integer and i cant convert it. See Picture:

image.png

  • DamoBird365 Profile Picture
    8,942 Microsoft Employee on at
    Re: Compare Lastsignedin Array with sharepoint list

    Hi @DefaultAdmin276 

     

    You would compare array1 with the get items of the list.  Filter on where the get items does not contain the values in array1, repurposed via a select.  This will give you an array of values that exist in the sharepoint list but not the array. Then you can either loop through with an apply to each and delete item or look at a batch delete method Power Automate Flow to batch delete SharePoint List Items (tachytelic.net).

     

    Damien

  • DefaultAdmin276 Profile Picture
    2 on at
    Re: Compare Lastsignedin Array with sharepoint list

    okay then my problem is another one. i try to explain as much as i can:

     

    Array1 gets all the inactive users and writes them in the Sharepoint list. 

    If the Sharepoint list has something that is not in Array1 how can i delete this element? I cant figure out how to make this. 

  • DamoBird365 Profile Picture
    8,942 Microsoft Employee on at
    Re: Compare Lastsignedin Array with sharepoint list

    Hi @DefaultAdmin276 

     

    You can compare two arrays without using an apply to each.  I have covered this in a video https://www.youtube.com/watch?v=G3Q1WuZTWuY&t=855s and also in a blog post Comparing two arrays without an apply to each? - Microsoft Tech Community.

     

    I hope this helps you but please let me know how you get on.


    Cheers
    Damien

    Please take a look and subscribe to my YouTube Channel for more Power Platform ideas and concepts. Thanks

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

Paul Stork – Community Spotlight

We are honored to recognize Paul Stork as our July 2025 Community…

Congratulations to the June Top 10 Community Leaders!

These are the community rock stars!

Announcing the Engage with the Community forum!

This forum is your space to connect, share, and grow!

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 497 Super User 2025 Season 1

#2
David_MA Profile Picture

David_MA 436 Super User 2025 Season 1

#3
Riyaz_riz11 Profile Picture

Riyaz_riz11 244 Super User 2025 Season 1