- Home
- Blog
Blog
Sharepoint REST set ShowInEditForm
On 28/11/2019
On 27/11/2019
Here is my page to develop my REST queries
if my query returns an object, it will display all properties of my obj, as in navigation console (console.dir(obj);)
if my query returns an array it will display all properties in input : "show properties'
complete code to add in a script editor webpart :see script
queries samples :
/_api/web/lists(guid'0E12917B-80F9-4765-8612-22A9AB467123')/items?$select=AssignedTo,Title&$orderby=DueDate desc&$filter=RelaunchDate eq null and Status eq 'In Progress'
/_api/web/getlist('/sites/csc-dev/Lists/myLMist')/fields?$select=Group,InternalName,Title,TypeAsString,Hidden
/_api/web/getlist('/sites/csc-dev/Lists/vdfdfvf')/fields?$select=Group,InternalName,Title,TypeAsString,Hidden&$filter=Hidden eq false and TypeAsString ne 'Computed' and startswith(InternalName, '_') eq false&$orderby=TypeAsString
/_api/web/getlist('/sites/csc-dev/Lists/myLMist')/fields?$select=Group,InternalName,Title,TypeAsString,Hidden
/_api/web/lists(guid'0E12917B-80F9-4765-8612-22A9AB46784E')/items?$select=AssignedTo/EMail,Created,Author/EMail,Body,DueDate,,ID,IsGroup,Modified,Editor/EMail,StartDate,Status,stepName,TaskGroup/EMail,TaskIdentifier,TaskProcessed,TaskProcessedBy/Title,TaskProcessedBy/Id,TaskProcessedBy/EMail,Title,WFFormFieldStepType,WFInstance&$orderby=DueDate desc&$filter=RelaunchDate eq null and Status eq 'In Progress'&$expand=Author,Editor,AssignedTo,TaskProcessedBy,TaskGroup
USER
{
Title: string;
EMail: string;
Id: number;
}
On 23/11/2019
Exception calling "ExecuteQuery" with "0" argument(s): "The request was aborted: Could not create SSL/TLS secure channel." SOLVED
Exception lors de l'appel de ExecuteQuery" avec 0" argument(s): La demandea été abandonnée: Impossible de créer un canal sécurisé SSL/TLS." : résolu
How to connect to a SSL/ TSL sharepoint site with CSOM in powershell
Start to call a request with your certificate
$CertificateThumbprint = "53836D3C35F949959D7E4038D5D39D7B"
$response = Invoke-WebRequest -Verbose -URI $anUrl -CertificateThumbprint $CertificateThumbprint -UseDefaultCredentials -SessionVariable websession -ErrorAction:Stop
# in this ExecutingWebRequest you should add the certificate to yoour request and add the authentification cookie
$request = $EventArgs.WebRequestExecutor.WebRequest
to list all your available certificate execute following script
On 30/10/2019
On 21/09/2019
Query sharepoint list with REST
use this end point to query your list http://test/sites/test/_api/Web/Lists/getbytitle('vvv')/items?$select=&$filter= Title eq 'entite du ga 1'
Example : http://test01/sites/test01/_api/Web/Lists/getbytitle('Aliste')/items?$select=Title,ID,Author/Title&$expand=Author&$filter= Title eq 'entite du toto 1'
to order by : &$orderby= Employee asc
to order by : &$orderby= Employee desc
to limit number of items returned : $top 5
to use paging : $skip 5
new paging mode add in your first query &$skiptoken=Paged=TRUE
in your response, you will receive next page query in odata.nextLink as below
/_api/Web/Lists/getbytitle(%27Initiatives%27)/items?%24skiptoken=Paged%3dTRUE%26p_ID%3d266&%24select=Title%2cID&%24orderby=ID+desc&p_ID=268&%24Top=3
expand lookup fields : $expand=city&$select=city/Id
viewfields : $select= Title, ID
filter : $filter=Title eq 'mon noeud' and ID ne 1
Numeric comparisons
- Lt
- Le
- Gt
- Ge
- Eq
- Ne
String comparisons
- startsWith
- substringof
- Eq
- Ne
Date and time functions
- day()
- month()
- year()
- hour()
- minute()
- second()
Full script to add in an Script Editor webpart
Powershell Csom Paged Caml Query
On 18/09/2019
$list = Get-PnPList -Identity $listTitle -ThrowExceptionIfListNotFound
$ctx = Get-PnPContext
$page = $null
$pageNumber = 0;
$rowLimit = 200
Do{
$stringBuilder = New-Object System.Text.StringBuilder
$stringBuilder.Append("<View Scope='RecursiveAll'>") | Out-Null
$stringBuilder.Append("<Query><Where></Where>")| Out-Null
$stringBuilder.Append("<OrderBy><FieldRef Name='ID' Ascending='TRUE' /></OrderBy>")| Out-Null
$stringBuilder.Append("</Query>")| Out-Null
$stringBuilder.Append("<ViewFields>")| Out-Null
$stringBuilder.Append("<FieldRef Name='ID' />")| Out-Null
$stringBuilder.Append("<FieldRef Name='Title' />")| Out-Null
$stringBuilder.Append("</ViewFields>")| Out-Null
$stringBuilder.Append("<RowLimit Paged='TRUE'>$($rowLimit)</RowLimit>")| Out-Null
$stringBuilder.Append("</View>")| Out-Null
$spqQuery = New-Object Microsoft.SharePoint.Client.CamlQuery
$spqQuery.ViewXml = $stringBuilder.ToString();
$spqQuery.ListItemCollectionPosition = $page
$pageNumber ++;
$spqQuery.ViewXml = $stringBuilder.ToString();
$itemki=$list.GetItems($spqQuery);
$spqQuery.ListItemCollectionPosition = $itemki.ListItemCollectionPosition
$ctx.Load($itemki)
$ctx.ExecuteQuery();
Write-Host "################## PAGE " $($page.PagingInfo) " #########################"
Write-Host "processing query results. Recs: $($itemki.Count)"
$Counter = 0;
foreach($item in $itemki)
{
Write-Host "$($item["ID"]) title pageNumber '$($pageNumber)' : $($item["Title"])"
}
$page = $itemki.ListItemCollectionPosition
}
Until($page -eq $null)
On 15/08/2019