It happens to everyone add some point you have two arrays and you want to check if some values are in both arrays or if a value is only in one of the arrays.
In this case I want to check if the members I have in a SharePoint Group are the same members I have in a dataverse team.
The first step is creating the two arrays. Make sure that both arrays are for example strings arrays or integer arrays otherwise you first have to convert them so that you compare strings with strings and integers with integers.
Now we are going to check if there are values in the SharePoint member array that aren’t in the CRM members array.
To do this we are going to loop over every item in the SP members array with an apply to each.
In the loop we are going to check if the CRM members array contains the current value of the loop.
If the CRM members array does not contain the current SP members value we are going to save this member to a new array.
After the loop is completed you have a new array with all the members that are in the SP members array buy aren’t in the CRM members array.
You can also do this to check which members are in the CRM members array and not in the SharePoint members array. By starting with the CRM members array in de apply to each loop and after that checking the SharePoint member array.
If you want to check if a member is in both array you have to add members to the new array if the condition is true instead of false.
Plaats een reactie