This article describes how to use the Get and Set Properties tasks that are prevalent throughout the Kivati task libraries.
Many of Kivati's task libraries include tasks that get and set properties of items such as files, folders, or SharePoint objects. These tasks usually take names such as GetXXXProperties or SetXXXProperties, where XXX is the type of object being modified. This article describes how to use these task types.
Get Properties
Most Get Properties tasks have a set of filter properties that control which properties are returned. These properties usually are in a category named "Behavior" or "Query" and usually include the following properties:
- QuerySimpleProperties. If true, simple valued properties, such as those properties that are of a primitive data type, are returned.
- QueryComplexProperties. If true, complex valued properties, such as those properties that represent a collectino of objects, are returned.
- QuerySecurityInfo. If true, properties associated with security, which may be privileged, are returned.
For most applications, you can simply set all of these query properties to true (which is the default). However, in some applications, you may incur a performance hit for querying complex properties, or not be able to query security information due to your permissions. In these cases, you can switch these query parameters off. If you do this, however, properties that are associated with the disabled query will return their default values (or null).
Some Get Properties tasks do not have these filters, or have additional or modified filter lists. If a task doesn't have filters, then all of its properties will always be returned. If a task has additional filters, read the documentation for the task to understand how the filters work together.
Set Properties
Most Set Properties tasks have two properties for each property on the object to set. One property represents the actual property value and can be any data type. The other property is always a Boolean property and is prefixed with "Set". This property controls whether to apply the value with its partner property to the object.
For example, consider a property named DisplayName. This property has a filter property named SetDisplayName. If SetDisplayName is true, then the value in DisplayName will be applied to the object that the Set Properties task is working on. Otherwise, this value will be ignored, even if DisplayName contains a value.
By default, all filter properties are off and most Set Properties tasks do nothing. If you want to set a value, you must first set the value of the main property and then set the filter property to true. Take care not to miss the filter property step or your property value will be ignored.
Kivati's task documentation (
http://www.kivati.net/kcom/taskhelp) is a good resource to consult as you are working with tasks to help better understand what each task property does.