Wordings with SharePoint Words

CSOM SharePoint Online List CRUD

Full Code Details

First, download the Microsoft SharePoint Online Client components from here. You can practice the CSOM scripts from here


Comic Words on SP Online CSOM
SharePoint Lists are fundamental building blocks of SharePoint. It is best to plan a List ahead and then start creating a List. It is better to have a list with less columns without creating scrollbars on a page.There are different types of houses like Hut,Palace,Building. There are different types of List Template like Picture,Document Library,Announcements etc. However, it is best to design your house based on your dream and build. SharePoint Custom List is the best template that gives you the choice to decide the columns.Below is sample to create List Fruits:
$listInfo = New-Object Microsoft.SharePoint.Client.ListCreationInformation;
$listInfo.Title="Fruits";
$listInfo.TemplateType=[Microsoft.SharePoint.Client.ListTemplateType]::GenericList;
$psList=$context.Web.Lists.Add($listInfo);
$psList.Description = "Fruits List through code";
$psList.Update();
$Context.ExecuteQuery();
Can you live in 10 own houses? Many use one thing and rent other things even if owning many things. Many times, a developer needs own chair and table inside their own room with server if needed. I was once in a company where the HR lost many of her houses and hired developers for her company to get her houses back. Many came from far away including me. I was hired though I went as a trainer. We were forced to sit and code for 9 hours straight. She, her husband, and her kid would come for 1 hour and get the status updates.Many were leaving. She did take me for one client meeting and showed the work of another developer in her mobile. They told me go out for the cost details. Wondered why? I escaped later with the help of police and their terrible plots. You look at specific houses which is dream house for your style. Similarly, in SharePoint, we look for specific items with a specific criteria.How? Using columns. Lets create a Location column.This would help to search for Fruits based on a Location.
$fieldType="Text";
$fieldName="Location";
$fieldXml="<Field Type='"+$fieldType +"' DisplayName='"+$fieldName +"' />";
$fruitField=$psListFruits.Fields.AddFieldAsXml($fieldXml, $true, [Microsoft.SharePoint.Client.AddFieldOptions]::AddFieldInternalNameHint);
$Context.ExecuteQuery();
A house is not a home without you. You keep various things, plant trees, make garden and water flows and you live peacefully in the house.SharePoint List is nothing without the data you enter.Lets add few items.
$fruits="Apple","Orange","Mango","Kiwi","Pomogranate";
$location="Washington";
foreach ($item in $fruits)
{
$fruitInfo = New-Object Microsoft.SharePoint.Client.ListItemCreationInformation;
$fruitItem=$psListFruits.AddItem($fruitInfo);
$fruitItem["Title"] = $item;
$fruitItem["Location"] = $location;
$fruitItem.Update() ;
} $Context.ExecuteQuery() ;
Reading can take you to a new dimension. Reading the right books can give you joy and reading the wrong books can mislead you. Technical books are neither good nor bad, but needed till the technology is updated. Lets read the SharePoint List items.
$camlQ= [Microsoft.SharePoint.Client.CamlQuery]::CreateAllItemsQuery();
$listItems=$psListFruits.GetItems($camlQ);
$Context.Load($listItems);
$Context.ExecuteQuery();
Searching for SharePoint List Items can be easy with Caml query. The Glossary in a book at the end is very helpful to find words you might be searching for. Searching for fruits beginning with A like "Apple". I believe that Gods Word must be true coming from Bible.In the beginning, God created Heaven and Earth. Still, I can never understand the Genesis and have understood that the science is false which says that Universe came out of nothing with Big Bang. I feel that science has made the world terrible with heartless doctors using numbers with various tests and cruel injections while God can heal a body without touching the body. Oh my mind! Its too little to grasp the big secrets or the Truth. Below is the complete query:
$fieldName="Title";
$fieldValue="Apple";
$sb = [System.Text.StringBuilder]::new();
[void]$sb.Append( '<View><Query>' );
[void]$sb.AppendLine("<FieldRef Name='"+$fieldName+"'/>");
[void]$sb.AppendLine("<Where>");
[void]$sb.AppendLine("<Eq><FieldRef Name='"+$fieldName+"' />");
[void]$sb.AppendLine("<Value Type='Text'>"+$fieldValue+"</Value>");
[void]$sb.AppendLine("</Where>");
[void]$sb.AppendLine("</Eq>");
[void]$sb.AppendLine("</Query><RowLimit>100</RowLimit></View>");
$sb.ToString();
$camlQ= New-Object Microsoft.SharePoint.Client.CamlQuery;
$camlQ.ViewXml=$sb.ToString();
$items = $psListFruits.GetItems($camlQ);
$context.Load($items);
$context.ExecuteQuery();
$appleItem=$items[0] ;
I heard the story of a daring lady who was so tired of life, wanted to go home and took overdose of medications. She was slowly going away from her body and she did go Home and meet God. She was at peace. She saw her uncle smiling. But, God her shot her back to the world. She came back, was very angry. She separated from her boyfriend and moved on in life. She helps many through the spiritual powers given to her by God. I feel we may escape the team meetings/status meetings, but cannot escape Gods meeting someday.Thankfully, I have not met God and hopefully I need not get angry for any separation after meeting Him. I may be separated from home, but I am happy to think of every day as a blessing from God. Everyday has a sunrise, clouds, sunset etc. If you observe, there is constant update everyday in nature and technology.Everyday, you might be converting yourself to a better new You, through conquest of bad habits.We are in the process of updating columns in SharePoint list. How to update a column?
$appleItem["Location"]="Australia";
Mankind can give only limited things, some of which increase the cravings and make us addicts. What God gives us, gives peace, satisfaction/contentment. God creates/gives the fruits, vegetables, air, water, health, healing, mind, body, breath,sleep,life, forgiveness etc. Though God gives freely for all, human plots (money) have brought about a system where some needs not reaching everyone,though needs are there for everyone. I feel each of us are very rich. If we count the blessings and not the money, we can clearly see that Our CountOfBlessings>=LifeTimeMoney. There are so many blessings which are unknown to us. I feel that everyday is a miracle to be a normal day. Hope we get the power to see the blessings we get everyday. How to find items where a Column=mango? Using in SharePoint CAML.
Many learning means unlearning. We try to forget bitter past to live a happy present. I was feeling very bitter from certain mistakes in the past, however, I realised that I am a better person now after taking resolve and efforts to never make past mistakes. Slowly, bitterness is changing to betterness. Learning never stops. The best teacher is your experience. Imagine "X" and "Y" are in a relation. "X" and "Y" have good and bad times. "X" complains to "Z" and "Z" do a terrible crime of trying to erase the memories of "Y" to make "Y" forget the past. "Z" is a enemy of "Y" and even hit "Y" in private taking use of the opportunity. Both "X" and "Y" want and need each other.Its always better to solve a problem by talking to each other directly, without a mediator and prayer to God together.The best way to escape from the past is not to avoid or forget/erase it. One person nearly died and went to the lap of God. He was in bliss.God showed him the scene where he stole a Coco Cola bottle and he had said, "Thank God, no one watched". God said nothing. I have a strong feeling that everything is recorded. We are at the end of CRUD in SharePoint list. Rather than delete an item, lets recycle.
Client Download

First, download the Microsoft SharePoint Online Client components from here. You can practice the CSOM scripts from here