ConvertoTo-KFCAML

Syntax

Get-KFNormalizedCaml 
  [-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.

[-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.

Discussion