Quantcast
Channel: SharePoint 2013 - Development and Programming forum
Viewing all articles
Browse latest Browse all 7589

Needing to get the value of MultiLine Textbox and Yes/No field with Powershell

$
0
0

I am having a hard time getting the value of a Note Field and Yes/No checkbox with Powershell. Typically with OnPrem I can use $item["field"].tostring() and this will work. With 365 I do not seem to be able to use .tostring()

Can anyone offer any guidance on how to accomplish this? 

$SPList = $GLOBAL:Web.Lists.GetByTitle("SomeList")
$spQuery = new-object Microsoft.SharePoint.client.camlquery
 $spQuery.viewxml="<View><Query><Where><And><Eq><FieldRef Name='Status' /><Value Type='Text'>TextValue</Value></Eq><Eq><FieldRef Name='ProcessInitialWorkflow' /><Value Type='Text'>True</Value></Eq></And></Where></Query></View>"
 $ListItems=$splist.GetItems($spQuery)
 $Context.Load($ListItems)
 $Context.ExecuteQuery()
  #If Item is found then Update List Item Code here.
  foreach($item in $listitems)
   {
   $item["Comments"].ToString();
   $Comments=$item["Comments"];
   write-host $Comments
   }

The CAML works great and I can do anything with other fields, I just cannot read those two column types.



Viewing all articles
Browse latest Browse all 7589

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>