Hi All,
I have a custom list with 1) title column 2) People column.
I simple need to check if the logged in user = user in the column 2, and if yes fill a List<> with column 1 value.
But when comparing, the value in list item is in different format than what we get by user.ToString()
Following is what I tried:
SPUser user = oWeb.CurrentUser;
List<String> usergrps = new List<String>();
foreach (SPListItem itemA in GrpSubsItems)
{
if (itemA["SubscribedBy"].ToString() == user.ToString())
usergrps.Add(itemA["Group"].ToString());
}itemA["SubscribedBy"].ToString() gives = 10;#Some Name
where as user.ToString() gives = i:0#.w|domain\user
Kindly guide if my approach is not correct. Thanks.
Regards, Nayan