• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 227
  • Last Modified:

Retrieve the list value from sharepoint through code

I have list

field f1 type yes or no(appeance is check box )
feild f2 text

now i want to update the list through console application through which i want get the value of f1(if its checked) update f2 as " completed"
if f1 is unchecked update f2 as " working"

Please can any one help me he code

Thanks
Latha
0
LathaLiquidHub
Asked:
LathaLiquidHub
  • 2
1 Solution
 
LathaLiquidHubAuthor Commented:
please any oe respond soon its very urgent
0
 
AtisCommented:
Try something like this (change url/list/id):  

param(
[string] $url =  ""
)

[System.Reflection.Assembly]::LoadWithPartialName("Microsoft.SharePoint")
$site=[Microsoft.Sharepoint.SPSite]($url)

$web =$site.openweb()
$list = $web.lists["<list name>"]
$item=$list.getItemById(<id>);

if ($item.item("f1")){
$item.item("f2") = "completed";
}
else
{
$item.item("f2") = "working";
}
$item.systemupdate();

$web.dispose();
$site.dispose();

Open in new window

0
 
LathaLiquidHubAuthor Commented:
Thanks
0

Featured Post

NFR key for Veeam Agent for Linux

Veeam is happy to provide a free NFR license for one year.  It allows for the non‑production use and valid for five workstations and two servers. Veeam Agent for Linux is a simple backup tool for your Linux installations, both on‑premises and in the public cloud.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now