2

I am trying to add items to the comments list based on the Post list having lookup relation ship between these two lists,can any one give me an example how to update the lookup column values using powershell in sharepoint 2013

1 Answer 1

1

You can either use PowerShell formatting to provide a string representation, or create a new SPFieldLookupValue object:

$lookupValueString = "{0};#{1}" -f $post.ID,$post.Title $lookupValue = New-Object Microsoft.SharePoint.SPFieldLookupValue -ArgumentsList $post.ID,$post.Title 

Then you assign the value to a field and then Update the item.

$comment["PostTitle"] = $lookupValue $comment.Update() 

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.