Friday, July 19, 2013

Get SharePoint 2010 Lookup field value for a list item using Powershell


    foreach ($item in $spListItems)
            {
                  if ($item["lookupcol"] -ne $null)
                  {
                      $lookup  = [Microsoft.SharePoint.SPFieldLookupValue]$item["lookupcol"];  
                      $lookupvalue = $lookup.LookupValue;
                        Write-Host "lookupcol value" $lookupvalue
                  }
                   

            }

No comments:

Post a Comment

Followers