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: