I have a collection "emailDistro" that accepts values from a People Picker dropdown as well as adds in the current user. This is done to ensure that the current user is always added to the people picker when they navigate to the next step or if they remove their name and navigate back.
ClearCollect(emailDistro,DataCardValue2.SelectedItems,
Table({
DisplayName: Office365Users.MyProfileV2().displayName,
Email: Office365Users.MyProfileV2().mail,
Claims: "i:0#.f|membership|" & Office365Users.MyProfileV2().mail
}));
However, this can create a duplicate of the current user. I need to distinct on the emailDistro collection. However, when I do this it puts the results into a "Value" column when I add it back into the emailDistro collection.
ClearCollect(tempEmailDistro,ForAll(Distinct(temp1emailDistro,ThisResult),Value));
How can I keep my emailDistro record whole wile removing duplicates?
The DataCardValue2.SelectedItems the values from this are not consistent with the values that come from User(). For example User().Email is all lowercase while DataCardValue2.Selected.Email is camelcase. The "Claims" value seems to be the field I need to disctinct as that has consistency.