title: Updating a lookup column in SharePoint Online list using PoweShell PnP
body: <p>I have worked on a PowerShell PnP script to update a column in a cloud-based SharePoint list.
  I want to update the column “Parent ID” with the content from “FH ID”. My script works fine on a regular column, but “Parent ID” is a lookup-column and therefore, it has three values: LookupID, LookupValue and TypeId (see image). My script updates LookupId, but we need it to update LookupValue.</p>
  <p>Can anyone help with a solution?</p>
  <p>In the below script we are testing on one “FH ID” = 1020</p>
  <pre><code>enter code here
  
  Connect-PnPOnline https://skat.sharepoint.com/sites/ICIfo
  
   function UpdateColumn(){
   $listName = &quot;FH kontakt&quot;
  
   $list = Get-PnPList $listName
  
   $items = Get-PnPListItem $listName
  
    foreach ($item in $items){
    if ($item[&quot;FH_x0020_ID&quot;] -eq &quot;1020&quot;){
    Write-Output $item[&quot;FH_x0020_ID&quot;]
    Write-Output $item[&quot;FH_x0020_Navn&quot;]
    Write-Output $item[&quot;Parent_x0020_ID&quot;]
    Write-Output &quot;&quot;
    Set-PnPListItem -List $listName -Identity $item -Values @{&quot;Parent_x0020_ID&quot; = $item[&quot;FH_x0020_ID&quot;]}
    }
    }
    }
  
    UpdateColumn
  </code></pre>