ConvertoTo-KFCAML
Syntax
Get-KFNormalizedCaml
[-Query] <string>
[-Config <hashtable>]
[-ThrowErrors[:$true]]
Get-KFNormalizedCaml
-WithWhere
[-Query] <string>
[-Config <hashtable>]
[-ThrowErrors[:$true]]
Get-KFNormalizedCaml
-WithQuery
[-RowLimit <int>]
[-Query] <string>
[-Config <hashtable>]
[-ThrowErrors[:$true]]
Get-KFNormalizedCaml
-WithView
[-RowLimit <int>]
[-Recursive[:$false]]
[-Query] <string>
[-Config <hashtable>]
[-ThrowErrors[:$true]]
Support
>= kenaflow 1.0.0
Return
String.
Description
The cmdlet is only available for SharePoint workflows!
This Cmdlet converts queries in kenaflow's own query language into common CAML.
Please read this aricle get get familar with kenaflow Queries.
This cmdlet can be used to test the kenaflow query processing mechanism to inspect the CAML query.
Import-Module "C:\Program Files\kenaflow\kenaflow.runtime.dll"
Start-KFSharePointModule -SharePointVersion sp2013
ConvertTo-KFCaml "{{test}} == string '5' & {{test2}} != null"
The query can contain placeholders of type "config" surronded with [[
and ]]
. At runtime they are replaced by values from the config entries from the SharePoint config list if the config list is configured.
In case of testing a CAML query outside of an automated workflow run you can use out cmdlet ConvertTo-KFCaml
with parameter -Config <hashtable>
:
Import-Module "C:\Program Files\kenaflow\kenaflow.runtime.dll"
Start-KFSharePointModule -SharePointVersion sp2013
$config = @{ "ourValue" = "5" }
ConvertTo-KFCaml "{{test}} == string [[ourValue]] & {{test2}} != null"
Parameters
[-Query] <string>
The kenaflow query string.
[-Config <hashtable>]
A PowerShell Hashtable object that contains config values for replacement.
-WithWhere
The CAML query is encapsulated with
<Where>...</Where>
.
-WithQuery
The CAML query is encapsulated with
<Query><Where>...</Where></Query>
.
-WithView
The CAML query is encapsulated with
<View><Query><Where>...</Where></Query></View>
.
[-RowLimit <int>]
Can be used with
-WithQuery
and-WithView
. With this parameter you can limit the amount of records that you get back. The result is<Query><Where>...</Where></Query><RowLimit>...</RowLimit>
. Of<View><Query><Where>...</Where></Query><RowLimit>...</RowLimit></View>
.
[-Recursive:[$false]]
Can be used with
-WithView
. With this parameter query results from all folder (sub) levels. The result<View Scope="RecursiveAll"><Query><Where>...</Where></Query></View>
.
[-ThrowErrors[:$true]]
This is a default parameter for all kenaflow cmdlets. If set to
$true
(default!) the engine will pass exception within the cmdlet to the script for further handling.
Example
Examples are in the description above.