Set Column

The Set Column plug-in allows you to set values in a form field or one or more SharePoint list columns.

Value Pairs

Value pair property listings correlate to columns in the SharePoint list. When a form is published, a corresponding SharePoint list is created. This new list includes columns based on fields in the form that have been exported as form library columns in FormEx sites. In DocEx sites, the user must define custom SharePoint list columns.

Value Pair

Description

List

The name of the SharePoint list to which you want to set the column.

site

The SharePoint site that contains the list to which you want to set the column.

column

The name of the column whose value you want to update. Add this parameter for each column you want to update.

query

The query parameters to search for a record listing in the SharePoint list. It will update only the first record in the result set of the query.

Note that the Query parameter does not work with the form field values; in other words, you can not specify an Xpath in the right-hand side of the query. For example, [Title] == @[//my:myFields/my:field1] will not work.

expression

The Expression parameter used to set the value to automatically route the form.

Note: In some cases, SharePoint items are configured to be checked out for editing. In such a case, if workflow updates a SharePoint column, the autocheckout parameter must be set to true.

Function

Description

$Date

Sets a date value that is relative to the current date. The argument specifies the number of days to add to the current date.

$Format

Allows formatting of a column value with a standard .NET format string. .NET formatting strings are described in Microsoft documentation. The first argument is the format string, and the second argument is the name of the column to format.

$Expression

Can be set to "True" or "False". Default value is "False".

Example: If the column is to be set to- '2+3':

If the Expression parameter is absent or set to false (the default), then the destination column will be set to '2+3' as a string.

If the Expression parameter="true", then the destination column will be set to 5, (i.e., the expression used in the value will be evaluated).

$ListFields

This parameter sets a value in a Sharepoint column.

TIP: You can use $ListField$ to set the 'Runable' SharePoint Column in the Winshuttle Central Solution Packages library to 'True' in order to enable Workflows to be run without approval, or 'False' so that all workflows require approval before running.

$Name

Invokes a name template and replaces the target column with the resulting name. The seed in this case is kept with the name template.

$RegExpExtract

Allows the Set Column plug-in to extract information from a column value and place it in another column. The first argument to the function is the quoted regular expression, and the second argument is the name of the field to apply it to. The regular expression runs on the value. The first back reference is extracted, and then placed into the target SharePoint column.

$Revision

Invokes a name template and replaces the target column with the resulting name. The seed in this case comes from a SharePoint column on the item.

Function Examples

Back to top

Function

Description

$Date(-2)

This example sets the target column to two days prior to the current date.

$Format("D", [MyDate])

This example formats the MyDate column in the long date format. For example, 12/31/2010 1:45:30 PM.

$Name([SelectedTemplate])

This example sets the target column to the next name template value defined by the contents of the column SelectedTemplate. If the SelectedTemplate column contains the value Project A Template, then that will be the name template used to generate the value.

$RegExpExtract(".*([0-9]+).*",[MyField])

This example extracts the first contiguous set of digits from the field MyField.

 

$Revision(MyTemplate:TemplateSeed)

This example generates a new name with the name template named MyTemplate with the seed in the TemplateSeed SharePoint column.

[Review] – off

This example sets the Review SharePoint column to the value off.

Example

  • site – http://acme.com/sv/FormEx
  • list – Employee
  • query – [Employee Name] == ‘Testuser’
  • [SharePointColumn1] - Value1
  • [SharePointColumn2] - Value2

This example queries the list Employee on the site http://acme.com/sv/FormEx for the row in which the Employee Name column matches ‘Testuser’.

If any rows are returned, it sets the SharePointColumn1 column to value1 and SharePointColumn2 to value2 in the first row of the SharePoint fields within the result set.